资源描述:
《QPSK星座图程序课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、DrawtheconstellationdiagramofQPSKbyMATLABQPSKQPSKisshortforquaternaryphaseshiftkeyingsignal,meaningphotographshiftkeyingis,isakindofdigitalmodulationmode.InmatlabtodrawtheQPSKconstellationdiagram,should:passpreparationpartfilterinitializationstartcal
2、culation,datagenerationQPSKmodulationfadingchanneladdwhiteGaussianNoiseQPSKdemodulationQPSKBERoutputresultThen,letusunderstandtheprogram:Preparationpart:sr=256000.0;%Symbolrateml=2;%ml:Numberofmodulationlevels(BPSK:ml=1,QPSK:ml=2,16QAM:ml=4)br=sr.*ml
3、;%Bitratend=800;%Numberofsymbolsthatsimulatesineachloopebn0=20;%Eb/N0IPOINT=8;%NumberofoversamplesFilterinitializationrfn=21;%Numberoftapsalfs=0.5;%Rollofffactor[xh]=hrollfcoef(irfn,IPOINT,sr,alfs,1);%Transmitterfiltercoefficients[xh2]=hrollfcoef(irf
4、n,IPOINT,sr,alfs,0);%ReceiverfiltercoefficientsSTARTCALCULATIONnloop=100;%Numberofsimulationloopsnoe=0;%Numberoferrordatanod=0;%Numberoftransmitteddataforiii=1:nloopDatageneration:data1=rand(1,nd*ml)>0.5;%rand:builtinfunctionQPSKModulation[ich,qch]=q
5、pskmod(data1,1,nd,ml);[ich1,qch1]=compoversamp(ich,qch,length(ich),IPOINT);[ich2,qch2]=compconv(ich1,qch1,xh);AttenuationCalculation:spow=sum(ich2.*ich2+qch2.*qch2)/nd;%sum:builtinfunctionattn=0.5*spow*sr/br*10.^(-ebn0/10);attn=sqrt(attn);%sqrt:built
6、infunctionFadingchannel%Generateddataarefedintoafadingsimulator[ifade,qfade]=sefade(ich2,qch2,itau,dlvl,th1,n0,itnd1,now1,length(ich2),tstp,fd,flat);%Updatafadingcounter%itnd1=itnd1+itnd0;AddWhiteGaussianNoise(AWGN)[ich3,qch3]=comb(ich2,qch2,attn);%a
7、ddwhitegaussiannoise[ich4,qch4]=compconv(ich3,qch3,xh2);syncpoint=irfn*IPOINT+1;ich5=ich4(syncpoint:IPOINT:length(ich4));qch5=qch4(syncpoint:IPOINT:length(qch4));QPSKDemodulation:[demodata]=qpskdemod(ich5,qch5,1,nd,ml);BitErrorRate(BER)noe2=sum(abs(d
8、ata1-demodata));%sum:builtinfunctionnod2=length(data1);%length:builtinfunctionnoe=noe+noe2;nod=nod+nod2;fprintf('%dt%e',iii,noe2/nod2);%fprintf:builtinfunctionend%foriii=1:nloopOutputresultber=noe/nod;fprintf('%dt%dt%dt%e',ebn0,noe,nod,noe/no