资源简介

使用matlab对瑞丽衰落信道进行仿真,信道建模

资源截图

代码片段和文件信息

%16QAM-OFDM system;
clear all;
clear all;

N = 1024;                                                        %the total number of all subcarriers
Np = 128;                                                         %the number of pilot carriers
B = 2e6;                                                         %bandwidth 2MHz
T = 1/B;
Ng = 256;                                                        %the length of Guard Interval
Xp = 3 + 1.0*j ;                                                      %pilot value
t= 0;  % erro code number

for u = 1:20                                             % run 20 times
%-------------------------------------Data generator--------------------------------------------------
xr1 = rand(1N-Np);
Xre = (-3) * (xr1 < 0.25) + (-1) * (0.25 <= xr1 & xr1 < 0.5)...
    + (0.5 <= xr1 & xr1 < 0.75) + 3 * (0.75 <= xr1 & xr1 < 1);
xr2 = rand(1N-Np);
Xim = (-3) * (xr2< 0.25) + (-1) * (0.25 <= xr2 & xr2 < 0.5)...
    + (0.5 <= xr2 & xr2 < 0.75) + 3 * (0.75 <= xr2 & xr2 < 1);
X = complex(XreXim);                                            %16QAM
% Xre = (-1) * (xr1 < 0.5) + 1 * (0.5 <= xr1 & xr1 < 1);
% xr2 = rand(1N-Np);
% Xim = (-1) * (xr2< 0.5) + 1 * (0.5 <= xr2 & xr2 < 1);
% X = complex(XreXim);                                            %QPSK
%----------------------------------  insert pilot in carriers    -------------------------------------
% pilots locate at 8*i + 3;
Xc = zeros(1N);                                                 %the carrier value
m = 0;
for i = 1 : N
    if(mod(i8) == 3)
         Xc(i) = Xp;
         m = m + 1;
    else
        Xc(i) = X(i - m);
    end
end
%----------------------------------OFDM modulation-------------------------------------------------------
Ym = ifft(XcN);
%----------------------------------Insert GI  CP---------------------------------------------------------
Y = [Ym(769:N)Ym];
%----------------------------------pass channel-----------------------------------------------------------
Yc = ray_channel(YT);
%---------------------------------add noice -------------------------------------------------------------
SNR = 40;
% for S=1:21
  %SNR= 10log10(Es/N0)
% N0 = var(Yc)/(10^(SNR/10));
% sgma = sqrt(N0/2);
% Yawgn=Yc+sgma*randn(1length(Yc))+sgma*randn(1length(Yc))*j;
Yawgn = awgn(YcSNR‘measured‘);
%-------------------------------------------------------------------------------------------------------     
% ----------------------------------------------OFDM RECEIVER-------------------------------------------  
%----------------------------------------------OFDM demodulation----------------------------------------
Yr = fft(YawgnN);
%-----------------------------------------------Pilot signal Extraction---------------------------------
c = 1;
for i = 3:8:N
    Yp(c) = Yr(i);
    c = c + 1;
end
%----------------------------------- Pilot signal Estimation with LS Algorithm -------------------------   
Hp = Yp ./ Xp;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4558  2005-09-12 18:55  朱志敏\OFDM_LS_directly.m

     文件        657  2005-09-12 18:52  朱志敏\ray_channell.m

     目录          0  2006-02-24 19:53  朱志敏

----------- ---------  ---------- -----  ----

                 5433                    4


评论

共有 条评论