资源简介

OFDM信道估计:经典的LS和MMSE估计,以及基于DFT的信道估计。目前MMSE信道估计的算法暂时存在一些问题。

资源截图

代码片段和文件信息

clear; close all; clf

Nfft = 32;
Ng = Nfft/8;            % guard space 
Nofdm = Nfft+Ng;
Nsym = 100;
Nps = 4;                % pilot spacing 
Np = Nfft/Nps;          % number of pilots per OFDM symbol
Nbps = 4;               % number of bits per (modulated) symbol
M = 2^Nbps;

modobject = modem.qammod(‘M‘M ‘SymbolOrder‘‘gray‘);
demodobject = modem.qamdemod(‘M‘M ‘SymbolOrder‘‘gray‘);

Es = 1;
A = sqrt(3/2/(M-1)*Es); % Signal energy and QAM normalization factor
SNR = 30;
MSE = zeros(16);
nose = 0;
for nsym = 1:Nsym
    Xp = 2*(randn(1Np)>0)-1;               % Pilot sequence generation
%     msgInt = randi(1Nfft-NpM);            % bit generation
    msgInt = round(15*rand(1Nfft-Np));
    data = A*modulate(modobjectmsgInt);   % QAM modulation
    
    ip = 0;
    pilotLoc = zeros(1Np);
    X = zeros(1Nfft);                      % data on sucarriers
    for k = 1:Nfft
        if mod(kNps)==1
            X(k) = Xp(floor(k/Nps)+1); 
            ip = ip+1;
            pilotLoc(ip) = k;
        else
            X(k) = data(k-ip);
        end
    end
    x = ifft(XNfft); 
    xt = [x(Nfft-Ng+1:Nfft) x];                     % IFFT and add CP
    
    h = [(randn+1j*randn) (randn+1j*randn)/2];      % a (2-tap) channel
    chLen=length(h);                                % real channel and its length
    H = fft(hNfft);
    HPowDb = 10*log10(abs(H.*conj(H)));             % real channel power in dB
    
    yChan = conv(xth);                         % channel path (convolution)
    yt = awgn(yChanSNR‘measured‘);            % add gaussian noise 
    y = yt(Ng+1:Nofdm);                             % remove CP
    Y = fft(y);
    
    % LS / MMSE channel estimation
    for m = 1:3
        if m == 1
            HEst = MMSE_chan_est(YXppilotLocNfftNpshSNR);
            method = ‘MMSE‘;                        % MMSE estimation
        elseif m == 2
            HEst = LS_chan_est(YXppilotLocNfftNps‘linear‘);
            method = ‘LS-linear‘;                   % LS estimation with linear interpolation
        else
            HEst = LS_chan_est(YXppilotLocNfftNps‘spline‘);
            method = ‘LS-spline‘;                   % LS estimation with spline interpolation
        end
        HEstPowDb = 10*log10(abs(HEst.*conj(HEst)));
        
        % DFT-based channel estimation
        hEst = ifft(HEst);
        hDft = hEst(1:chLen);
        HDft = fft(hDftNfft);
        HDftPowDb = 10*log10(abs(HDft.*conj(HDft)));
        
        % plot
        if nsym == 1
            subplot(319+2*m);
            plot(HPowDb‘b‘); grid on; hold on;
            plot(HEstPowDb‘r:+‘);
            legend(‘True Channel‘method);
            
            subplot(320+2*m);
            plot(HPowDb‘b‘); grid on; hold on;
            plot(HDftPowDb‘r:+‘);
            legend(‘True Channel‘[method ‘ with DFT‘]);
        end
        
        % record MSE of estimators.
   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         661  2017-12-18 11:52  channel estimation\LS_chan_est.m
     文件        1334  2017-12-18 11:52  channel estimation\MMSE_chan_est.m
     文件        3979  2017-12-18 10:18  channel estimation\channel_estimation.m
     文件         823  2017-12-18 11:51  channel estimation\interpolate_chan.m
     目录           0  2017-12-18 11:52  channel estimation\

评论

共有 条评论