⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_fluorescent_effects.m

📁 这是一个关于ofdm在802.11协议下的源码
💻 M
字号:
function FadingMatrixNew = add_fluorescent_effects(FadingMatrix, ...
                            IEEE_802_11_Case, PowerLineFrequency_Hz, ...
                            NumberOfTxAntennas, NumberOfRxAntennas, ...
                            FadingSamplingTime_s, RandomInterfererToCarrierRatio, ...
                            Random_Phase)

% function FadingMatrixNew = add_fluorescent_effects(FadingMatrix, ...
%                             IEEE_802_11_Case, PowerLineFrequency_Hz, ...
%                             NumberOfTxAntennas, NumberOfRxAntennas, ...
%                             FadingSamplingTime_s, RandomInterfererToCarrierRatio, ...
%                             Random_Phase)
%
% Adds the effects of fluorescent lights to the existing FadingMatrix.
% 
% Inputs
% * 2-D matrix FadingMatrix of size
%   (NumberofTxAntennas*NumberOfRxAntennas*NumberOfPaths) x
%   FadingNumberOfIterations containing FadingNumberOfIterations
%   samples of NumberofTxAntennas * NumberOfRxAntennas * NumberOfPaths
% * Variable IEEE_802_11_Case, defines the IEEE 802.11 Case to
%   be simulated (being either D or E)
% * Variable PowerLineFrequency_Hz, sets the power line
%   frequency (50 Hz in Europe, 60 Hz in the United States)
% * Variable NumberOfTxAntennas, number of antenna elements
%   at Tx
% * Variable NumberOfRxAntennas, number of antenna elements
%   at Rx
% * Vector FadingSamplingTime_s of size 1 x FadingNumberOfIterations
%   containing the fading samples in the time domain
% * Variable RandomInterfererToCarrierRatio
% * Variable Random_Phase
% 
% Output
% * 2-D matrix FadingMatrix of size
%   (NumberofTxAntennas*NumberOfRxAntennas*NumberOfPaths) x
%   FadingNumberOfIterations containing FadingNumberOfIterations
%   samples of NumberofTxAntennas * NumberOfRxAntennas * NumberOfPaths
%
% Revision history
%
% January 2004 - Bug fix, erroneous dB to linear conversion of
%                amplitudes, reported by Angelo Poloni and
%                Stefano Valle, STMicroelectronics Srl, Italy
%                ( Bas Dijkstra )
% October 2003 - Creation
%                ( Bas Dijkstra )
%
%
% STANDARD DISCLAIMER
%
% The Computer Science Institute of the University of Namur (hereafter
% "FUNDP-INFO") is furnishing this item "as is". FUNDP-INFO does not
% provide any warranty of the item whatsoever, whether express,
% implied, or statutory, including, but not limited to, any warranty
% of merchantability or fitness for a particular purpose or any
% warranty that the contents of the item will be error-free.
%
% In no respect shall FUNDP-INFO incur any liability for any damages,
% including, but not limited to, direct, indirect, special, or
% consequential damages arising out of, resulting from, or any way
% connected to the use of the item, whether or not based upon
% warranty, contract, tort, or otherwise; whether or not injury was
% sustained by persons or property or otherwise; and whether or not
% loss was sustained from, or arose out of, the results of, the
% item, or any services that may be provided by FUNDP-INFO.
%
% (c) Laurent Schumacher, FUNDP-INFO - January 2004

% Amplitudes of the modulating signal
Amplitudes = [0 -15 -20];
% Taps to be used in model D
Taps_D = [12 14 16];
% Taps to be used in model E
Taps_E = [3 5 7];

% Initialization of the modulation matrix
ModulationMatrix = zeros(size(FadingMatrix));

% Computation of the modulation function g(t)
g = zeros(3,size(FadingSamplingTime_s,2));

for k = 1:3
    g(k,:) = (10^(Amplitudes(k)/20)).*exp(j.*(4.*pi.*(2*(k-1)+1).*PowerLineFrequency_Hz.*FadingSamplingTime_s+Random_Phase));
end;

ModulationFunction = sum(g);

% Filling of the ModulationMatrix, later to be added to the FadingMatrix
if (IEEE_802_11_Case == 'D')
    
    for (ii=1:NumberOfTxAntennas)
        for (jj=1:NumberOfRxAntennas)
            for k=1:3
                ModulationMatrix((((Taps_D(k)-1)*NumberOfTxAntennas*NumberOfRxAntennas) ...
                    +((ii-1)*NumberOfRxAntennas)+jj),:) = ModulationFunction;
            end;
        end;   
    end;
    
else       
    for (ii=1:NumberOfTxAntennas)
        for (jj=1:NumberOfRxAntennas)
            for k=1:3
                ModulationMatrix((((Taps_E(k)-1)*NumberOfTxAntennas*NumberOfRxAntennas) ...
                    +((ii-1)*NumberOfRxAntennas)+jj),:) = ModulationFunction;
            end;
        end;   
    end;
end;

% Multiplication of the modulation matrix and the fading matrix
% g(t) = g(t) * c(t)
ModulationMatrix = ModulationMatrix.*FadingMatrix;

% Calculation of the energy of both matrices
ModulationMatrixEnergy = sum(sum(abs(ModulationMatrix).^2));
FadingMatrixEnergy     = sum(sum(abs(FadingMatrix).^2));

% Comparison and calculation of the normalization constant alpha
% NormalizationConstant * (I/C)_real = (I/C)_drawn
RealInterfererToCarrierRatio = ModulationMatrixEnergy/FadingMatrixEnergy;
NormalizationConstant        = RandomInterfererToCarrierRatio/RealInterfererToCarrierRatio;
  
% Final adaptation of the fading matrix
% c'(t) = c(t) + (alpha * c(t) *g(t))
FadingMatrixNew = FadingMatrix + (sqrt(NormalizationConstant)*ModulationMatrix);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -