1 OFDM调制解调原理
一个OFDM信号可以表示为
每个子载波可采用正交幅度调制(QAM)或相移键控调制(PSK)。其中Xi,k为第i个OFDM符号在第k个子载波上传输的数据;N为子载波个数;fc为载波频率;△f=1/T为子信道带宽;T=NTs为每个信道上符号的持续时间(周期)。
OFDM系统框图如图2:
图 2 OFDM 的调制解调
若令
有:
一个OFDM周期包含整数倍个子载波周期,因此各信号中的子载波之间是相互正交的,OFDM信号满足Nyquist第一准则,即各个子载波之间不存在码间串扰。
登录后复制
close all clear all %% 仿真基本参数 f_delta = 15e3; %子载波间隔15KHz pilot_interval = 5; %插入导频间隔 M = 2; %每星座符号比特数,对应QPSK调制 ce_method = 1; %信道估计方法,1和2分别对应LS和MMSE symbol_len = 1000; %OFDM符号数 p=1;%% 仿真可配置参数 awgn_en = 0; %信道类型,为1表示AWGN信道,为0表示 ETU信道 fd = 300; %最大多普勒扩展 sta_num = 10; %仿真次数统计 num_carriers = input(‘请输入子载波数:’); %子载波数 cp_length = input(‘请输入循环前缀长度:’); %循环前缀长度%% 仿真过程=== % 产生0-1随机序列 =>(交织)=> 符号映射 => 串并转换 => 插入导频 % => IFFT变换 => 加循环前缀CP => 并串转换 => (信道编码) => 多径信道% => 加AWGN => (信道译码)=> 串并转换 =>去循环前缀CP => 去导频 => % FFT变换 / 信道估计与频域均衡 => 并串转换 => 解映射 =>(解交织) % => 计算误码率 => 绘制误码率曲线 % ==================================================%% 产生随机序列======= sr0=sourcebits(symbol_lennum_carriersM);%随即序列长度为子载波数目×ofdm符号数×M%% 卷积编码 [sr,tre1,tblen,p]=conv(sr0);%% 交织======= sr = interlace(sr,M);%% 符号映射======= ak=qpsk_modulation(sr);%% 串并转换======= parallel_ak = reshape(ak,num_carriers,symbol_len/p);%% 插入导频======= pilot_bit = ones(num_carriers*2,1);%生成导频序列 [insert_pilot_out,count,pilot_seq] = … insert_pilot_f(parallel_ak,pilot_bit,pilot_interval,num_carriers);%% IFFT变换======= OFDMmoddata_out = ifft (insert_pilot_out,num_carriers)*sqrt(num_carriers);%离散傅立叶变换点数为子载波数%% 加循环前缀CP======= CP_output=Inset_CP(OFDMmoddata_out,cp_length);%% 并串转换======= [m,n] = size(CP_output);%并行数据的长度为加cp后的数据矩阵的元素总数mn OFDMmoddata_out_serial = reshape(CP_output,mn,1);%% 多径信道======= %信道参数为36.101协议指定 SNR = 0:2:34; % 用于检测的信噪比值 for snr_index = 1:length(SNR) fs = num_carriers * f_delta; ts = 1/fs; tau = [0,50,120,200,230,500,1600,2300,5000]/(10^9); pdb = [-1.0 ,-1.0 ,-1.0 ,0, 0, 0, -3.0, -5.0, -7.0]; chan = rayleighchan(ts,fd,tau,pdb); chan.ResetBeforeFiltering = 0; Channel_data = OFDMmoddata_out_serial; %经过多径信道 if (awgn_en == 1) Add_Multipath_data = Channel_data; else if (fd ~= 0) Add_Multipath_data = filter(chan,Channel_data); end end Add_noise_data = awgn(Add_Multipath_data,SNR(snr_index),‘measured’);%% 去导频,取出导频矩阵======= [DeletePolit_out,H_ifft] = Get_pilot(Delete_CP_out,pilot_interval,num_carriers,p);%% 直接解调,无信道补偿=== fft_out = fft (DeletePolit_out)/sqrt(num_carriers); %并串转换 serial_ak_1 = reshape(fft_out,num_carriers*symbol_len/p,1); %解映射 demod_sr_1 = qpsk_demodulation(serial_ak_1); %解交织 demod_sr_1 = delete_interlace(demod_sr_1,M); % %viterbi译码 demod_sr_1 = viterbi(demod_sr_1,tblen,tre1);%% 信道估计与频域均衡===== estimation_output = ls_estimation(DeletePolit_out,H_ifft,pilot_seq,num_carriers,p); %并串转换 serial_ak_2 = reshape(estimation_output,num_carriers*symbol_len/p,1);%% =计算误码率===== errorbit_num_1(snr_index) = length(find(demod_sr_1~= sr0));%统计直接解调错误比特数 BER_1(snr_index) = errorbit_num_1(snr_index) / (symbol_lennum_carriersM); errorbit_num_2(snr_index) = length(find(demod_sr_2 ~= sr0));%统计信道估计与频域均衡错误比特数 BER_2(snr_index) = errorbit_num_2(snr_index) / (symbol_lennum_carriersM);end %% 绘制 SNR-BER 曲线semilogy(SNR,BER_1,‘b*-.’); hold on; semilogy(SNR,BER_2,‘m±’); xlabel(‘SNR (dB)’); ylabel(‘BER’); grid on; legend(‘直接解调’,‘信道估计与频域均衡’) axis([SNR(1) SNR(end) 0.01 1])1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.
2014a
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删