ds_cdma 仿真源程序

ds_cdma 仿真源程序

ID:14240388

大小:113.00 KB

页数:18页

时间:2018-07-27

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

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

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

2、+++++++++++++irfn=21;%滤波器阶数IPOINT=8;%过采样倍数alfs=0.5;%滚降因子[xh]=hrollfcoef(irfn,IPOINT,sr,alfs,1);[xh2]=hrollfcoef(irfn,IPOINT,sr,alfs,0);%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++++扩频码初值设定+++++++++++++++++++user=1;%用户数seq=1;%1:m序列2:Gold

3、序列3:正交Gold序列stage=3;%序列阶数ptap1=[13];%第一个线性移位寄存器的系数ptap2=[23];%第二个线性移位寄存器的系数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];%用于产生衰落的波数th1=[0.0,0.0];%延迟波形的初始相位itnd1=[3001,4004];%设置衰落计数now1=2;%主径和

6、延迟波形总数tstp=1/sr/IPOINT/clen;%时间分辨率fd=160;%多普勒频移[Hz]flat=1;%平坦瑞利衰落环境itndel=nd*IPOINT*clen*30;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%++++++++++++++++++++++仿真运算开始++++++++++++++++++++++++nloop=1000;%仿真循环次数noe=0;nod=0;forii=1: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,qch1,IPOINT);%过采样[ich3,qch3]=compconv2(ich2,qch2,xh

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

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

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

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