ofdm_demod.m
资源名称:MIMO-OFDM.rar [点击查看]
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:1k
源码类别:
传真(Fax)编程
开发平台:
Matlab
- function ofdm_sym = ofdm_demod( fine_freq_out, PrefixRatio, N_subc, N_sym_ts, N_ts ,N_Rx_ant ,AddChFreq)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % 实现OFDM的基本解调
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- if ~AddChFreq
- ofdm_sym = zeros(N_subc,N_sym_ts*N_ts,N_Rx_ant);
- cp_len = round(PrefixRatio*N_subc);
- for ant = 1:N_Rx_ant
- ofdm_tmp = reshape( fine_freq_out(1,:,ant), N_subc*(1+PrefixRatio) , N_sym_ts*N_ts );
- cp_cut = ofdm_tmp( cp_len + 1:end,: );
- % fft乘1/sqrt(N_subc)以保证变换前后能量不变
- % 我们假设频域的样点是在[-fs/2 fs/2]中的, fs是采样频率
- % fftshift目的是使得变换后的频域样点在[-fs/2 fs/2]中,而不是[0 fs]中
- ofdm_sym(:,:,ant) = fftshift(1/sqrt(N_subc) * fft( cp_cut ), 1);
- end
- else
- ofdm_sym = NaN;
- end