ofdm_mod.m
资源名称:MIMO-OFDM.rar [点击查看]
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:1k
源码类别:
传真(Fax)编程
开发平台:
Matlab
- function transmit_signal = ofdm_mod(pilot_added,PrefixRatio,N_subc,N_used,N_sym_ts,N_ts,...
- Idx_used,N_Tx_ant,AddChFreq)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % 实现OFDM的基本调制
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- if ~AddChFreq
- transmit_signal = zeros(1,N_subc*N_sym_ts*N_ts*(1+PrefixRatio),N_Tx_ant);
- cp_len = round(PrefixRatio*N_subc);
- for ant = 1:N_Tx_ant
- % ifft乘sqrt(N_subc)以保证变换前后能量不变
- % 我们假设频域的样点是在[-fs/2 fs/2]中的, fs是采样频率
- % 使用fftshift函数目的是使得变换前的频域样点转换到[0 fs]中,以满足IFFT变换的要求
- ofdm_frame = sqrt(N_subc) * ifft( fftshift( pilot_added(:,:,ant), 1 ) );
- cp = ofdm_frame(N_subc - cp_len + 1:N_subc ,:);
- ofdm_frame = [cp;ofdm_frame];
- % 加窗处理
- % 转换为串行信号
- transmit_signal(:,:,ant) = reshape( ofdm_frame, 1, N_subc * N_sym_ts * N_ts *(1+PrefixRatio) );
- end
- else
- transmit_signal = NaN; % 如果频域加信道,transmit_signal不存在. 赋值NaN以防止警告
- end