QPSK星座图程序

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

DrawtheconstellationdiagramofQPSKbyMATLABQPSKQPSKisshortforquaternaryphaseshiftkeyingsignal,meaningphotographshiftkeyingis,isakindofdigitalmodulationmode.InmatlabtodrawtheQPSKconstellationdiagram,should:•passpreparationpart•filterinitialization•startcalculation,datageneration•QPSKmodulation•fadingchannel•addwhiteGaussianNoise•QPSKdemodulationQPSKBERoutputresultThen,letusunderstandtheprogram:Preparationpart:sr=256000.0;%Symbolrateml=2;%ml:Numberofmodulationlevels(BPSK:ml=1,QPSK:ml=2,16QAM:ml=4)br=sr.*ml;%Bitratend=800;%Numberofsymbolsthatsimulatesineachloopebn0=20;%Eb/N0IPOINT=8;%NumberofoversamplesFilterinitializationrfn=21;%Numberoftapsalfs=0.5;%Rollofffactor[xh]=hrollfcoef(irfn,IPOINT,sr,alfs,1);%Transmitterfiltercoefficients[xh2]=hrollfcoef(irfn,IPOINT,sr,alfs,0);%ReceiverfiltercoefficientsSTARTCALCULATIONnloop=100;%Numberofsimulationloopsnoe=0;%Numberoferrordatanod=0;%Numberoftransmitteddataforiii=1:nloopDatageneration:data1=rand(1,nd*ml)0.5;%rand:builtinfunctionQPSKModulation[ich,qch]=qpskmod(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:builtinfunctionattn=0.5*spow*sr/br*10.^(-ebn0/10);attn=sqrt(attn);%sqrt:builtinfunctionFadingchannel%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);%addwhitegaussiannoise[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(data1-demodata));%sum:builtinfunctionnod2=length(data1);%length:builtinfunctionnoe=noe+noe2;nod=nod+nod2;fprintf('%d\t%e\n',iii,noe2/nod2);%fprintf:builtinfunctionend%foriii=1:nloopOutputresultber=noe/nod;fprintf('%d\t%d\t%d\t%e\n',ebn0,noe,nod,noe/nod);%fprintf:builtinfunctionfid=fopen('BERqpsk.dat','a');fprintf(fid,'%d\t%e\t%f\t%f\t\n',ebn0,noe/nod,noe,nod);%fprintf:builtinfunctionfclose(fid);thankyou

1 / 11
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功