《QPSK星座图程序》由会员分享,可在线阅读,更多相关《QPSK星座图程序(11页珍藏版)》请在金锄头文库上搜索。
1、DrawtheconstellationdiagramofQPSKbyMATLAB QPSK QPSKisshortforquaternaryphaseshiftkeyingsignal meaningphotographshiftkeyingis isakindofdigitalmodulationmode InmatlabtodrawtheQPSKconstellationdiagram should passpreparationpartfilterinitializationstartcalculation datagenerationQPSKmodulationfadingchann
2、eladdwhiteGaussianNoiseQPSKdemodulation QPSK BERoutputresultThen letusunderstandtheprogram Preparationpart sr 256000 0 Symbolrateml 2 ml Numberofmodulationlevels BPSK ml 1 QPSK ml 2 16QAM ml 4 br sr ml Bitratend 800 Numberofsymbolsthatsimulatesineachloopebn0 20 Eb N0IPOINT 8 Numberofoversamples Filt
3、erinitialization rfn 21 Numberoftapsalfs 0 5 Rollofffactor xh hrollfcoef irfn IPOINT sr alfs 1 Transmitterfiltercoefficients xh2 hrollfcoef irfn IPOINT sr alfs 0 Receiverfiltercoefficients STARTCALCULATION nloop 100 Numberofsimulationloopsnoe 0 Numberoferrordatanod 0 Numberoftransmitteddataforiii 1
4、nloopDatageneration data1 rand 1 nd ml 0 5 rand builtinfunction QPSKModulation 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 builtinfunctionattn 0 5 spow sr br 10 ebn0 10 attn
5、sqrt attn sqrt builtinfunction Fadingchannel 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 compco
6、nv 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 builtinfunctionnod2 length data1 length builtinfunctionnoe noe noe2 nod nod nod2 fprintf d t e n iii noe2 nod2 fprintf builtinfunctionend foriii 1 nloop Outputresult ber noe nod fprintf d t d t d t e n ebn0 noe nod noe nod fprintf builtinfunctionfid fopen BERqpsk dat a fprintf fid d t e t f t f t n ebn0 noe nod noe nod fprintf builtinfunctionfclose fid thankyou