欢迎来到天天文库
浏览记录
ID:9532886
大小:29.00 KB
页数:6页
时间:2018-05-03
《单信道oofdm单边带传输matlab代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、附:单信道OOFDM单边带传输Matlab代码clearall;closeall;clc;%systemparameterBitrate=10e9;%Samplingrate=10e9;Ns=512;%子载波个数FS=2*Ns;%IFFT的点数,2倍过采样eta=1/8;N_cp=eta*FS;%cp长度为128Symbol_size=N_cp+FS;%符号长度df=Bitrate/FS;fc=0;%f_sub=df:df:Bitrate;子载频的选择OFDM_Bandwidth=Ns*df;%符号带宽T_ifft=1/df;T_cp=eta*T_ifft;T_symbol=T_i
2、fft+T_cp;q=4;%insertzerosT_sampling=T_symbol/(q*(FS+N_cp));Rs=1/T_sampling;t=T_sampling:T_sampling:T_symbol;%fibertransmissionparameterWaveLenth=1550e-9;c=3e8;D=17e-12/1e-9;%D=17e-3;L=80;apha=0.2;%dB/km光纤损耗系数FiberLoss=apha*L;f=-Rs/2+Rs/(q*(FS+N_cp)):Rs/(q*(FS+N_cp)):Rs/2;%ff=(OFDM_Bandwidth+fc
3、)/(q*(FS+N_cp)):(OFDM_Bandwidth+fc)/(q*(FS+N_cp)):(OFDM_Bandwidth+fc);%mapping&modulationM=16;%全部采用16-QAM的映射方式Modu_eff=log2(M);OMI=0.5;%transmitterPN=2^20;%传输的比特序列数BitsPerSymbol=Ns*Modu_eff;%每个符号的序列数N_symbol=PN/BitsPerSymbol;N_pilot=16;%导频数为16PilotSpace=floor(N_symbol/N_pilot);Bits_seq=randint
4、(Ns,N_symbol,M);%随机产生比特序列Bits_gray=qammod(Bits_seq,M,0,'gray');%正交振幅调制Bits_gray(:,(1:PilotSpace:N_symbol))=1;Bits_gray((1:2:Ns),(1:PilotSpace:N_symbol))=-1;%Bits_gray(:,(1:4*PilotSpace-1:N_symbol))=1-i;%Bits_gray(:,(1:4*PilotSpace+1:N_symbol))=-1+i;%Bits_gray(:,(1:4*PilotSpace+2:N_symbol))=-1-
5、i;INFO=zeros(FS,N_symbol);INFO(((Ns+1):FS),:)=Bits_gray;Insert_zero=zeros((q-1)*FS,N_symbol);Input=[INFO;Insert_zero];%输入信号OFDMSequence=FS*ifft(Input);%ifft后输出的OFDM序列t1=T_sampling:T_sampling:N_symbol*T_symbol;%addingcpOFDMSignal=[OFDMSequence((((FS-N_cp)*q+1):end),:);OFDMSequence];%RF-toneinse
6、rtion&IQmodulation%频域插值(数模转换)V_I=real(OFDMSignal);%实部V_Q=imag(OFDMSignal);%虚部Amplify=sqrt(Ns*mean((abs(Bits_gray)).^2));RF_tone=mean(Amplify)*exp(j*2*pi*fc*t1);Vin=RF_tone'+OFDMSignal(:);Vin_I=real(Vin);Vin_Q=imag(Vin);Vrms_I=sqrt(sum(Vin_I.^2)/length(Vin_I));Vrms_Q=sqrt(sum(Vin_Q.^2)/length(V
7、in_Q));Vpi_I=Vrms_I/OMI;Vpi_Q=Vrms_Q/OMI;Opt_I=cos(pi*(1-Vin_I/Vpi_I)/2);Opt_Q=cos(pi*(1-Vin_Q/Vpi_Q)/2);Opt_out=Opt_I+j*Opt_Q;Opt_out1=pi*Vin/Vpi_I;%opticalfiberH_fiber=exp(j*pi*D*L*WaveLenth^2*f.^2/c);Opt_seq=reshape(Opt_out1,length(O
此文档下载收益归作者所有