您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 企业文化 > 最佳接收机的MATLAB
二元调制最佳接收机的MATLAB仿真程序%bicomsim.mcloseallclearall%P0=0.5;%P1=0.5;%fs=N/TbN=10;L=1000;k0=2;Th1=0;A=1;rand('state',sum(100*clock));fordb=-5:15,r=10^(db/10);sigma=0.5*A*sqrt(N)/10^(db/20);i0=db+6;Pe0PSK(i0)=0.5*erfc(sqrt(r));Pe0ASKa(i0)=0.5*erfc(sqrt(r/2));Pe0ASKb(i0)=0.5*erfc(sqrt(r/4));Pe0FSK(i0)=Pe0ASKa(i0);Th=0.5*0.5*A^2*N;%2ASKcount=0;forj=1:L;fori=1:N,NN(i)=sigma*randn(1,1);%N(m,sigma)s0(i)=0;s1(i)=A*sin(2*pi*k0*i/N);x0(i)=s0(i)+NN(i);x1(i)=s1(i)+NN(i);endsumm0=0;fori=1:N,summ0=summ0+x0(i)*s1(i);endsumma=summ0;ifsummaTh,count=count+1;endsumm0=0;fori=1:N,summ0=summ0+x1(i)*s1(i);endsummb=summ0;ifsummbTh,count=count+1;endendPeASK(i0)=0.5*count/L;Th=0;%2PSKcount=0;forj=1:L;fori=1:N,NN(i)=sigma*randn(1,1);s0(i)=A*sin(2*pi*k0*i/N);Th=0;s1(i)=-A*sin(2*pi*k0*i/N);%2PSKx0(i)=s0(i)+NN(i);x1(i)=s1(i)+NN(i);endsumm0=sum(x0.*s0);summ1=sum(x0.*s1);summa=summ0-summ1;sma(j)=summa;ifsummaTh,count=count+1;endsumm0=sum(x1.*s0);summ1=sum(x1.*s1);summb=summ0-summ1;smb(j)=summb;ifsummbTh,count=count+1;endendPePSK(i0)=0.5*count/L;Th=0.5*0.5*A^2*N;%2FSKcount=0;forj=1:L;fori=1:N,NN(i)=sigma*randn(1,1);s0(i)=A*sin(2*pi*k0*i/N);Th=0;s1(i)=A*sin(2*pi*(k0+1)*i/N);x0(i)=s0(i)+NN(i);x1(i)=s1(i)+NN(i);endsumm0=sum(x0.*s0);summ1=sum(x0.*s1);summa=summ0-summ1;sma(j)=summa;ifsummaTh,count=count+1;endsumm0=sum(x1.*s0);summ1=sum(x1.*s1);summb=summ0-summ1;smb(j)=summb;ifsummbTh,count=count+1;endendPeFSK(i0)=0.5*count/L;endi=1:21;i2=i-6;semilogy(i2,Pe0PSK,'b',i2,Pe0ASKb,'b',i2,Pe0FSK,'b');holdonsemilogy(i2,PePSK,'r*',i2,PeASK,'ro',i2,PeFSK,'r+')axis([-5151.0e-061.0e0])
本文标题:最佳接收机的MATLAB
链接地址:https://www.777doc.com/doc-5004465 .html