dscdma仿真源程序

dscdma仿真源程序

ID:31726264

大小:90.73 KB

頁數(shù):26頁

時間:2019-01-17

dscdma仿真源程序_第1頁
dscdma仿真源程序_第2頁
dscdma仿真源程序_第3頁
dscdma仿真源程序_第4頁
dscdma仿真源程序_第5頁
資源描述:

《dscdma仿真源程序》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。

1、%main_DSCDMA.m%這個仿真程序用于實現(xiàn)DS-CDMA通信系統(tǒng)仿真%%+++++++++++++++++++++++準備咅盼+++++++++++++++++++++++++++clearall;sr=256000.0;%符號速率ml=2;%調(diào)制階數(shù)br=sr*ml;%比特速率nd=100;%符號數(shù)SNR二5:1:10;%Eb/No%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%+++++++++++++++++++++濾波器初值設(shè)定++++++++

2、+++++++++++++++irfn=21;%濾波器階數(shù)IPOINT=&%過采樣倍數(shù)alfs=0.5;%滾降因子[xh]=hrollfcoef(irfn,IPOINT,sr,alfs,1);[xh2]=hrollfcoef(irfn,IPOINT,sr,alfs,0);%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++++jj^弓馬設(shè)定+++++++++++++++++++user=1;%用戶數(shù)seq=1;%l:m序

3、列2:Gold序歹ij3:正交Gold序列stage=3;%序列階數(shù)ptapl=[13];%第一個線性移位寄存器的系數(shù)ptap2=[23];%第二個線性移位寄存器的系數(shù)regil=[111];%第一個線性移位寄存器的初始化regi2=[111];%第二個線性移位寄存器的初始化%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++disp('start');%+++++++++++++++++擴頻碼的產(chǎn)生+++++++++++++++++forebn0=-5:l:10s

4、witchseqcase1%m序列code=mseq(stage,ptap1,regi1,user);case2%Gold序列m1=mseq(stage,ptap1,regil);%正交Gold序列m2=mseq(stage,ptap2,regi2);code=goldseq(m1,m2,user);case3m1=mseq(stage,ptap1,regi1);m2=mseq(stage,ptap2,regi2);code=[goldseq(ml,m2,user),zeros(user,1)];endcode=code*2-1;clen=

5、length(code);%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%+++++++++++++++++++++f右+++++++++++++++++++++++rfade=0;%瑞利衰減0:不考慮1:考慮itau=[0,8];%延時dlvl1=[0.0,40.0];%衰減電平nO=67];%用于產(chǎn)生衰落的波數(shù)thl=[0.0,0.0];%延遲波形的初始相位itndl=[3001,4004];%設(shè)置衰落計數(shù)nowl=2;%主徑和延遲波形總數(shù)tstp=1/s

6、r/IPOINT/clen;%時間分辨率fd=160;%多普勒頻移[Hz]flat=1;%平坦瑞利衰落環(huán)境itndel=nd*IPOINT*clen*30;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++>f^真女臺++++++++++++++++++++++++nloop=1000;%仿真循環(huán)次數(shù)noe=0;nod=0;forii=l:nloop%++++++++++++++++++++++++++++++++++

7、+++++++++++++++++++++++++++++%++++++++++++++++++++++++發(fā)射機++++++++++++++++++++++++++++data=rand(user,nd*ml)>0.5;[ich,qch]=qpskmod(data,user,nd,ml);%QPSK調(diào)制[ich1,qch1]=spread(ich,qch,code);%擴頻[ich2,qch2]=compoversamp2(ich1,qchlJPOINT);%過采樣[ich3,qch3]=compconv2(ich2,qch2,xh);%

8、濾波ifuser==1ich4=ich3;qch4=qch3;elseich4HSum(ich3)_qch4uSum(qch3)八end%++++++++++++++++++++

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動畫的文件,查看預(yù)覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負責(zé)整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時聯(lián)系客服。
3. 下載前請仔細閱讀文檔內(nèi)容,確認文檔內(nèi)容符合您的需求后進行下載,若出現(xiàn)內(nèi)容與標題不符可向本站投訴處理。
4. 下載文檔時可能由于網(wǎng)絡(luò)波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。