dft_estimator.m

来自「OFDM系统的仿真代码MATLAB环境下」· M 代码 · 共 28 行

M
28
字号
function data_cir = dft_estimate(pilot_freq_cir)
% pilot_freq_cir: cir at the pilot frequency
% channel_cir: cir at all the frequency

global sim_consts;

N1 = sim_consts.NumPilotSubc; % the length of the window should be the same as the number of pilot per ofdm symbol
N2 = 64;

if sim_consts.WindowFunction == 'chebyshev'    % 切比雪夫窗函数
    A = 40;
    w1 = chebwin(N1,A);
    w2 = chebwin(N2,A);
elseif sim_consts.window_function == 'kaiser'
    beta=5;    % 凯塞窗函数
    w1=kaiser(N1,beta);
    w2=kaiser(N2,beta);
end

for i = 1:size(pilot_freq_cir,2) 
    window_pilot_freq_cir = pilot_freq_cir(:,i);
    window_pilot_time_cir = ifft(window_pilot_freq_cir);
    window_subchan_time_cir = [window_pilot_time_cir;zeros(58,1)];    
    window_subchan_freq_cir = fft(window_subchan_time_cir);
    subchan_freq_cir(:,i) = window_subchan_freq_cir;
end
 
data_cir = subchan_freq_cir(sim_consts.DataSubcIdx,:);

⌨️ 快捷键说明

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