您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 酒店餐饮 > 用matlab仿真DFE均衡器
DFE均衡器1.基本原理均衡器用来消除码间干扰,DFE即判决均衡器的主要思路是:一旦一个信息符号被检测并被判定后,就可在检测后续符号之前预测并消除由这个信息符号带来的码间干扰。其基本功能是消除当前估计中的符号间干扰,这个干扰是由前面检测的符号流引起的。2.仿真程序(1)DFE主程序如下:clearallcloseallclcglobalcir_matrix_tglobalNglobalflagflag=1;snr=[6:16];iter_num=10;N=1000;ber=[];forsnr_index=1:length(snr)err=0;lambda=power(10,-snr(snr_index)/20);foriter=1:iter_numequal_bit=[];bit_signal=randint(1,N);%bit_signal为1000列的随机矩阵,矩阵的元素为0和1modul_signal=mod_4PSK(bit_signal);rx_sym=Through_channel(modul_signal,N/2);rx_signal=awgn(rx_sym,snr(snr_index));%rx_signal=rx_symequal_signal=equalizer(rx_signal,lambda);fork=1:N/2ifreal(equal_signal(1,k))0.5equal_bit=[equal_bit00];elseifreal(equal_signal(1,k)-0.5)equal_bit=[equal_bit11];elseifimag(equal_signal(1,k))0.5equal_bit=[equal_bit10];elseequal_bit=[equal_bit01];endenderrr=sum(abs(equal_bit-bit_signal));err=err+errr;enderr/(N*iter_num);snr_index;ber=[bererr/(N*iter_num)];endbersemilogy(snr,ber,'*-')holdongridon(2)equalizer子程序如下:functionequal_out=equalizer(in_signal,lambda)globalcir_matrix_tglobalNglobalflagNf=16;Nb=8;len=length(in_signal);b_signal=zeros(1,Nb);fork=1:N/2cir=cir_matrix_t(:,k).';cir_len=length(cir);Hff=convmtx(cir,Nf);Hfb=Hff(:,end-cir_len+2:end);Hfb=[Hfb,zeros(16,Nb-cir_len+1)];Vff=eye(Nf+cir_len-1);Vff(Nf+1:end,Nf+1:end)=zeros(cir_len-1);Sff=Hff(:,Nf);Fffn=inv(Hff*Vff*Hff'+(lambda^2)*eye(Nf))*Sff;Ffb=-Hfb'*Fffn;f_signal=[zeros(1,max(0,k+Nf-1-len))in_signal(min(len,k+Nf-1):-1:k)].';out_sym=Fffn'*f_signal+Ffb'*b_signal.';equal_out(1,k)=hard_4QAM_demodul(out_sym);b_signal=[equal_out(1,k)b_signal(1:end-1)];end(3)hard_4QAM_demodul子程序如下:functionsymb_hard=hard_4QAM_demodul(in_signal)in_signal=in_signal*exp(j*pi/4);ifreal(in_signal)0ifimag(in_signal)0symb_hard=1;elsesymb_hard=-1*i;endelseifimag(in_signal)0symb_hard=i;elsesymb_hard=-1;endend(4)Through_channel子程序如下:functionrx_signal=Through_channel(tx_signal,signal_len)globalcir_matrix_tglobalflagcir_matrix=[];ifflag==0C2=[-0.59175538208125-0.26921505269338i;0;0;0;0;0;-0.75903722101890-0.034804026909066i];elseC2=[0.210.3162-0.20.1-0.050.02].';C2=C2/norm(C2)';endc_end=[0.210.3162-0.20.1-0.050.02].';%[-0.39200.01520.83200.0152-0.39200.01780.163].';c_end=c_end/norm(c_end);%cir_cir=C2;cir_len=length(c_end);cir_matrix=[cir_matrixC2];fork=1:signal_len+cir_len-1cir_matrix=[cir_matrixC2+(c_end-C2)/(2*(signal_len+cir_len-1))];endcir_matrix_t=cir_matrix;[cir_len,conv_len]=size(cir_matrix);tx_temp=zeros(1,cir_len);fork=1:conv_lenifksignal_len+1tx_temp=[tx_signal(1,k)tx_temp(1,1:end-1)];elsetx_temp=[0tx_temp(1,1:end-1)];endcir=cir_matrix(:,k);cir=cir/norm(cir)';rx_signal(1,k)=tx_temp*cir;end(5)mod_4PSK子程序如下:functiony=mod_4PSK(x)%4PSKModulator%x--binaryinputbits.Thelengthofxmustbemultiplesof4.%y--complexoutput.vectorcons=exp(j*([8264]*pi/4));%cons=exp(j*([18237654]*pi/4));temp=reshape(x,2,length(x)/2);y=cons(bi2de(temp')+1);3.运行结果如下ber=0.04860.03380.02030.00690.00570.00210.00050000678910111210-410-310-210-1
本文标题:用matlab仿真DFE均衡器
链接地址:https://www.777doc.com/doc-7314010 .html