仿真高斯白噪声信道下QPSK的EbN0与误比特率.doc

上传人:scccc 文档编号:13430426 上传时间:2021-12-25 格式:DOC 页数:15 大小:404KB
返回 下载 相关 举报
仿真高斯白噪声信道下QPSK的EbN0与误比特率.doc_第1页
第1页 / 共15页
仿真高斯白噪声信道下QPSK的EbN0与误比特率.doc_第2页
第2页 / 共15页
仿真高斯白噪声信道下QPSK的EbN0与误比特率.doc_第3页
第3页 / 共15页
亲,该文档总共15页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《仿真高斯白噪声信道下QPSK的EbN0与误比特率.doc》由会员分享,可在线阅读,更多相关《仿真高斯白噪声信道下QPSK的EbN0与误比特率.doc(15页珍藏版)》请在三一文库上搜索。

1、仿真高斯白噪声信道下 QPSK 的 EbN0 与 误比特率之间的关系QPSK调制与解调在 MATLAB 平台上的实现QPSK即四进制移向键控(Quaternary Phase Shift Keying,它利用载波的四种不同相位来表示数字信息,由于每一种载波相位代表两个比特信息,因此 每个四进制码元可以用两个二进制码元的组合来表示。两个二进制码元中的前 一个码元用 a表示,后一个码元用 b表示。QPSK信号可以看作两个载波正交 2PSK信号的合成,下图表示QPSK正交 调制器。输入串/井由QPSK信号的调制可知,对它的解调可以采用与2PSK信号类似的解调方法进行解调。解调原理图如下所示,同相支路

2、和正交支路分别采用相干解调方 式解调,得到l(t)和Q(t),经过抽样判决和并/串交换器,将上下支路得到的并 行数据恢复成串行数据输入带通濾波器COS 07低迪滤液器一抽样判决输.出 并/串 . 变换sin低適.抽样濾波胖判决< I;-载波%调相法clear all close all t=-1:0.01:7-0.01;tt=le ngth(t);x1=o nes(1,800);for i=1:ttif (t(i)>=-1 & t(i)<=1) | (t(i)>=5 & t(i)<=7); x1(i)=1;else x1(i)=-1; end en

3、d t1=0:0.01:8-0.01;t2=0:0.01:7-0.01;t3=-1:0.01:7.1-0.01;t4=0:0.01:8.1-0.01;tt1=le ngth(t1);x2=o nes(1,800);for i=1:tt1if (t1(i)>=0 & t1(i)<=2) | (t1(i)>=4& t1(i)<=8); x2(i)=1;else x2(i)=-1; endend f=0:0.1:1;xrc=0.5+0.5*cos(pi*f);y1=c onv (x1,xrc)/5.5;y2=c onv (x2,xrc)/5.5;n0=rand

4、n( size(t2);f1=1;i=x1.*cos(2*pi*f1*t); q=x2.*si n(2*pi*f1*t1);I=i(101:800);Q=q(1:700);QPSK=sqrt(1/2).*l+sqrt(1/2).*Q;QPSK_ n=(sqrt(1/2).*I+sqrt(1/2).*Q)+n0;n 1=ra ndn( size(t2); i_rc=y1.*cos(2*pi*f1*t3); q_rc=y2.*si n(2*pi*f1*t4);l_rc=i_rc(101:800);Q_rc=q_rc(1:700);QPSK_rc=(sqrt(1/2)*l_rc+sqrt(1/2).

5、*Q_rc);QPSK_rc_n1=QPSK_rc+ n1;figure(1)subplot(4,1,1);plot(t3,i_rc);axis(-1 8 -1 1);ylabel('a 序列');subplot(4,1,2);plot(t4,q_rc);axis(-1 8 -1 1);ylabel('b 序列');subplot(4,1,3);plot(t2,QPSK_rc);axis(-1 8 -1 1);ylabel('合成序列'); subplot(4,1,4);plot(t2,QPSK_rc_n1);axis(-1 8 -1 1);yl

6、abel('加入噪声');效果图:c-ear a= cose a=br'in H randinoe3 严o二)八br'- H br'in(12e3= br'Q H br'in(22e3=daQr一 H 2*br'-+_k八 daQrIQ H 2*br'Q+_k八daQr二 *epmaf(daQrl-2p1)八 daQrIQl Hrepmaf(daQrIQ20=)八for i2_ke4daQrl-2(iHdaQr二(三data_Q2(i)=data_Q1(i);end;f=0:0.1:1;xrc=0.5+0.5*cos(pi

7、*f);data2_rc=c onv (data2,xrc)/5.5;data_Q2_rc=c onv (data_Q2,xrc)/5.5;f1=1;t1=0:0.1:1e3+0.9;n0=ran d(size(t1);I_rc=data_l2_rc.*cos(2*pi*f1*t1);Q_rc=data_Q2_rc.*si n(2*pi*f1*t1);QPSK_rc=(sqrt(1/2)*l_rc+sqrt(1/2).*Q_rc);QPSK_rc_n0=QPSK_rc+ n0;%解调I_demo=QPSK_rc_n0.*cos(2*pi*f1*t1);Q_demo=QPSK_rc_n0.*si

8、 n(2*pi*f1*t1);%低通滤波I_recover=c on v(l_demo,xrc);Q_recover=co nv(Q_demo,xrc);I=I_recover(11:10010);Q=Q_recover(11:10010);t2=0:0.05:1e3-0.05;t3=0:0.1:1e3-0.1;%抽样判决data_recover=;for i=1:20:10000data_recover=data_recover I(i:1:i+19) Q(i:1:i+19);end;bit_recover=;for i=1:20:20000if sum(data_recover(i:i+1

9、9)>0data_recover_a(i:i+19)=1;bit_recover=bit_recover 1;elsedata_recover_a(i:i+19)=-1;bit_recover=bit_recover -1;endenderror=0;dd = -2*bit_i n+1;ddd=dd'ddd仁 repmat(ddd,20,1);for i=1:2e4ddd2(i)=ddd1(i);endfor i=1:1e3if bit_recover(i)=ddd(i)error=erro 叶1;endendp=error/1000;figure(1)subplot(2,1,1

10、);plot(t2,ddd2);axis(0 100 -2 2);title('原序列');subplot(2,1,2);plot(t2,data_recover_a);axis(0 100 -2 2);title(解调后序列');效果图:原序列%设定T=1,不加噪声clear all close all%调制bit_in = ran din t(1e3, 1, 0 1); bit=bit_i n(1:2:1e3);bit_Q = bit_i n(2:2:1e3);data=-2*bit_l+1;data_Q = -2*bit_Q+1;data仁repmat(data_

11、l',20,1); data_Q1=repmat(data_Q',20,1);for i=1:1e4data_I2(i)=data_I1(i); data_Q2(i)=data_Q1(i); end;t=0:0.1:1e3-0.1;f=0:0.1:1;xrc=0.5+0.5*cos(pi*f);data2_rc=c onv (data2,xrc)/5.5; data_Q2_rc=c onv (data_Q2,xrc)/5.5;f1=1;t1=0:0.1:1e3+0.9;I_rc=data_l2_rc.*cos(2*pi*f1*t1);Q_rc=data_Q2_rc.*si n(

12、2*pi*f1*t1);QPSK_rc=(sqrt(1/2)*l_rc+sqrt(1/2).*Q_rc);%解调I_demo=QPSK_rc.*cos(2*pi*f1*t1);Q_demo=QPSK_rc.*si n(2*pi*f1*t1);I_recover=c on v(l_demo,xrc);Q_recover=co nv(Q_demo,xrc); l=l_recover(11:10010);Q=Q_recover(11:10010);t2=0:0.05:1e3-0.05;t3=0:0.1:1e3-0.1;data_recover=;for i=1:20:10000data_recove

13、r=data_recover l(i:1:i+19) Q(i:1:i+19);end;ddd = -2*bit_i n+1;ddd 1= repmat(ddd',10,1);for i=1:1e4ddd2(i)=ddd1(i);endfigure(1)subplot(4,1,1);plot(t3,l);axis(0 20 -6 6); subplot(4,1,2);plot(t3,Q);axis(0 20 -6 6); subplot(4,1,3);plot(t2,data_recover);axis(0 20 -6 6);subplot(4,1,4);plot(t,ddd2);axi

14、s(0 20 -6 6);效果图:20% QPSK误码率分析SNRi ndB仁 0:2:10;SNRi ndB2=0:0.1:10;for i=1:le ngth(SNR in dB1)pb,ps=cm_sm32(SNR in dB1(i); smld_bit_err_prb(i)=pb; smld_symbol_err_prb(i)=ps;end;for i=1:le ngth(SNR in dB2)SNR=exp(SNRi ndB2(i)*log(10)/10); theo_err_prb(i)=Qfu nct(sqrt(2*SNR); end;title('QPSK误码率分析&#

15、39;);semilogy(SNRi ndB1,smld_bit_err_prb,'*'); axis(0 10 10e-8 1);hold on;% semilogy(SNR in dB1,smld_symbol_err_prb,'o'); semilogy(SNRi ndB2,theo_err_prb);legend(仿真比特误码率,理论比特误码率');hold off;fun ctio ny=Qfu nct(x) y=(1/2)*erfc(x/sqrt(2);fun ctio npb,ps=cm_sm32(SNRi ndB) N=10000;E=1

16、;SNR=10A(SNRi ndB/10);sgma=sqrt(E/SNR)/2;s00=1 0;s0仁0 1;si 仁-1 0;s10=0 -1;for i=1:Ntemp=ra nd;if (tempv0.25)dsource1(i)=0;dsource2(i)=0;elseif (temp<0.5)dsource1(i)=0;dsource2(i)=1;elseif (temp<0.75)dsource1(i)=1;dsource2(i)=0;elsedsource1(i)=1;dsource2(i)=1;end;end;numo fsymbolerror=0;num ofb

17、iterror=0;for i=1:Nn=sgma*ra ndn( size(s00);if(dsource1(i)=0)&(dsource2(i)=0) r=s00+n;elseif(dsource1(i)=0)&(dsource2(i)=1) r=s01+ n;elseif(dsource1(i)=1)&( dsource2(i)=0) r=s10+n;elser=s11+ n;end;c00=dot(r,s00);c01= dot(r,s01);c10=dot(r,s10);c11=dot(r,s11);c_max=max(c00 c01 c10 c11);if

18、(c00=c_max)decis1=0;decis2=0;elseif(c01=c_max)decis1=0;decis2=1;elseif(c10=c_max)decis1=1;decis2=0;elsedecis1=1;decis2=1;end;symbolerror=0;if(decis1=dsource1(i)num ofbiterror二num ofbiterror+1; symbolerror=1;end;if(decis2=dsource2(i)num ofbiterror =num ofbiterror+1; symbolerror=1;end;if(symbolerror=1)numo fsymbolerror =numo fsymbolerror+1; end;end;ps=num ofsymbolerror/N;pb=num ofbiterror/(2*N);效果图:

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1