dscdma仿真源程序

dscdma仿真源程序

ID:31726264

大小:90.73 KB

页数:26页

时间:2019-01-17

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

《dscdma仿真源程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、%main_DSCDMA.m%这个仿真程序用于实现DS-CDMA通信系统仿真%%+++++++++++++++++++++++准备咅盼+++++++++++++++++++++++++++clearall;sr=256000.0;%符号速率ml=2;%调制阶数br=sr*ml;%比特速率nd=100;%符号数SNR二5:1:10;%Eb/No%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%+++++++++++++++++++++滤波器初值设定++++++++

2、+++++++++++++++irfn=21;%滤波器阶数IPOINT=&%过采样倍数alfs=0.5;%滚降因子[xh]=hrollfcoef(irfn,IPOINT,sr,alfs,1);[xh2]=hrollfcoef(irfn,IPOINT,sr,alfs,0);%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++++jj^弓马设定+++++++++++++++++++user=1;%用户数seq=1;%l:m序

3、列2:Gold序歹ij3:正交Gold序列stage=3;%序列阶数ptapl=[13];%第一个线性移位寄存器的系数ptap2=[23];%第二个线性移位寄存器的系数regil=[111];%第一个线性移位寄存器的初始化regi2=[111];%第二个线性移位寄存器的初始化%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++disp('start');%+++++++++++++++++扩频码的产生+++++++++++++++++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];%用于产生衰落的波数thl=[0.0,0.0];%延迟波形的初始相位itndl=[3001,4004];%设置衰落计数nowl=2;%主径和延迟波形总数tstp=1/s

6、r/IPOINT/clen;%时间分辨率fd=160;%多普勒频移[Hz]flat=1;%平坦瑞利衰落环境itndel=nd*IPOINT*clen*30;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++>f^真女台++++++++++++++++++++++++nloop=1000;%仿真循环次数noe=0;nod=0;forii=l:nloop%++++++++++++++++++++++++++++++++++

7、+++++++++++++++++++++++++++++%++++++++++++++++++++++++发射机++++++++++++++++++++++++++++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,qchlJPOINT);%过采样[ich3,qch3]=compconv2(ich2,qch2,xh);%

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

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。