ds_cdma 仿真源程序

ds_cdma 仿真源程序

ID:14240388

大小:113.00 KB

頁數(shù):18頁

時間:2018-07-27

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

《ds_cdma 仿真源程序》由會員上傳分享,免費在線閱讀,更多相關內容在行業(yè)資料-天天文庫

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

2、+++++++++++++irfn=21;%濾波器階數(shù)IPOINT=8;%過采樣倍數(shù)alfs=0.5;%滾降因子[xh]=hrollfcoef(irfn,IPOINT,sr,alfs,1);[xh2]=hrollfcoef(irfn,IPOINT,sr,alfs,0);%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++++擴頻碼初值設定+++++++++++++++++++user=1;%用戶數(shù)seq=1;%1:m序列2:Gold

3、序列3:正交Gold序列stage=3;%序列階數(shù)ptap1=[13];%第一個線性移位寄存器的系數(shù)ptap2=[23];%第二個線性移位寄存器的系數(shù)regi1=[111];%第一個線性移位寄存器的初始化regi2=[111];%第二個線性移位寄存器的初始化%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++disp('--------------start-------------------');%+++++++++++++++++擴頻碼的產生+++++++++++++++

4、++forebn0=-5:1:10switchseqcase1%m序列code=mseq(stage,ptap1,regi1,user);case2%Gold序列m1=mseq(stage,ptap1,regi1);m2=mseq(stage,ptap2,regi2);code=goldseq(m1,m2,user);case3%正交Gold序列m1=mseq(stage,ptap1,regi1);m2=mseq(stage,ptap2,regi2);code=[goldseq(m1,m2,user),zeros(user,1)];endcode=co

5、de*2-1;clen=length(code);%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%+++++++++++++++++++++信道衰減初值設定+++++++++++++++++++++++rfade=0;%瑞利衰減0:不考慮1:考慮itau=[0,8];%延時dlvl1=[0.0,40.0];%衰減電平n0=[6,7];%用于產生衰落的波數(shù)th1=[0.0,0.0];%延遲波形的初始相位itnd1=[3001,4004];%設置衰落計數(shù)now1=2;%主徑和

6、延遲波形總數(shù)tstp=1/sr/IPOINT/clen;%時間分辨率fd=160;%多普勒頻移[Hz]flat=1;%平坦瑞利衰落環(huán)境itndel=nd*IPOINT*clen*30;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++仿真運算開始++++++++++++++++++++++++nloop=1000;%仿真循環(huán)次數(shù)noe=0;nod=0;forii=1:nloop%++++++++++++++++++++++++++

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

8、);%濾波ifuser==1ich4=ich3;qch4=qch3;elseich4=sum(

當前文檔最多預覽五頁,下載文檔查看全文

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

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