ofdm系统有无cp与均衡的系统比较
MATLAB源程序如下:
-
- function [s_out] = ofdm_mod_eq( s_in )
- %% ofdm 调制,带均衡
- %% 输入:二进制序列
- %% 输出:ofdm调制后符号
- %global CP_len;
- global nSubC
- global ifft_len;
- global symbolPerCarrier;
- global bitPerSymbol;
- global trainingSymbols;
- global trainingSymbols_len;
- global CP_len;
- global carriers;
- len = length(s_in);
- SQam = reshape(s_in, nSubC,len/nSubC); %串并转换
- PQam = Qam4_mod(SQam);
- tmpTable = [-1,1,i,-i];
- trainingSymbols_len = 10;
- trainingSymbols = (tmpTable(floor(4*rand(trainingSymbols_len,nSubC))+1 ))';
- PQam = cat(2,zeros(nSubC,1),PQam);
- PQam = cat(2,trainingSymbols,PQam);
- carriers = (1: nSubC) + (floor( ifft_len/4) - floor(nSubC/2));
- conj_carriers = ifft_len - carriers + 2;
- P_IFFT = zeros(ifft_len,1 + symbolPerCarrier + trainingSymbols_len);
- P_IFFT(carriers,:) = PQam;
- P_IFFT(conj_carriers,:)=conj(PQam) ;
- PCh = (ifft( P_IFFT ,ifft_len,1));
- PCh2 = cat(1, PCh((ifft_len-CP_len+1):ifft_len,:), PCh); % 添加 CP
- s_out = reshape(PCh2, 1, (ifft_len+CP_len)*(symbolPerCarrier +trainingSymbols_len + 1)); %并串转换
复制代码
所有资料51hei提供下载:
新建文件夹.rar
(5.55 KB, 下载次数: 11)
|