资源简介
这是一个ds-cdma系统的多用户检测程序 包括传统、最小均方误差、解相关三种方法

代码片段和文件信息
%DD解相关多用户检测器和CD传统多用户检测器的误码率比较(八个用户)
clear all;
snr_indb=0:8;
for k=1:length(snr_indb)
snr=10^(snr_indb(k)/10);
sgma=1;
eb=2*(sgma^2)*snr;
LC=31;
echip=eb/LC;
N=10000;%number of bits transmitted
%creat PN codes
fbconnection=[0 1 0 0 1];
mseq=m_sequence(fbconnection);
fbconnection1=[0 0 1 0 1];
fbconnection2=[0 1 1 1 1];
goldseq=gold_seq(fbconnection1fbconnection2);
%N=2^length(fbconnection)-1;
ind1=find(mseq==0);
mseq(ind1)=-1;
ind2=find(goldseq==0);
goldseq(ind2)=-1 %creat 31*31 gold sequence
temp=goldseq;
pn_seq1=temp(3:);
pn_seq2=temp(4:);
pn_seq3=temp(7:);
pn_seq4=temp(10:);
pn_seq5=temp(15:);
pn_seq6=temp(20:);
pn_seq7=temp(26:);
pn_seq8=temp(31:);
% comput matrix R
pp=[pn_seq1;pn_seq2;pn_seq3;pn_seq4;pn_seq5;pn_seq6;pn_seq7;pn_seq8];
RR=(1/LC)*pp*pp‘;
R=inv(RR);
%generate codes
for i=1:N
temp1=rand;
if(temp1<0.5)dsource1(i)=-1;
else dsource1(i)=1;
end;
temp2=rand;
if(temp2<0.5)dsource2(i)=-1;
else dsource2(i)=1;
end;
temp3=rand;
if(temp3<0.5)dsource3(i)=-1;
else dsource3(i)=1;
end;
temp4=rand;
if(temp4<0.5)dsource4(i)=-1;
else dsource4(i)=1;
end;
temp5=rand;
if(temp5<0.5)dsource5(i)=-1;
else dsource5(i)=1;
end;
temp6=rand;
if(temp6<0.5)dsource6(i)=-1;
else dsource6(i)=1;
end;
temp7=rand;
if(temp7<0.5)dsource7(i)=-1;
else dsource7(i)=1;
end;
temp8=rand;
if(temp8<0.5)dsource8(i)=-1;
else dsource8(i)=1;
end;
end;
number_of_err=0;
number_of_err1=0;
for i=1:N
%将每个bit repeat LC=31 times
for j=1:LC
repeatdata1(j)=dsource1(i);
repeatdata2(j)=dsource2(i);
repeatdata3(j)=dsource3(i);
repeatdata4(j)=dsource4(i);
repeatdata5(j)=dsource5(i);
repeatdata6(j)=dsource6(i);
repeatdata7(j)=dsource7(i);
repeatdata8(j)=dsource8(i);
end;
%tranmit signal is:
trans_sig1=sqrt(echip)* repeatdata1.*pn_seq1;
trans_sig2=sqrt(echip)* repeatdata2.*pn_seq2;
trans_sig3=sqrt(echip)* repeatdata3.*pn_seq3;
trans_sig4=sqrt(echip)* repeatdata4.*pn_seq4;
trans_sig5=sqrt(echip)* repeatdata5.*pn_seq5;
trans_sig6=sqrt(echip)* repeatdata6.*pn_seq6;
trans_sig7=sqrt(echip)* repeatdata7.*pn_seq7;
trans_sig8=sqrt(echip)* repeatdata8.*pn_seq8;
%add AWGN noise
noise=sgma*randn(1LC);
% receive signal
for j=1:LC
rtemp(j)=trans_sig1(j)+trans_sig2(j)+trans_sig3(j)+trans_sig4(j)+trans_sig5(j)+trans_sig6(j)+trans_sig7(j)+trans_sig8(j);
end;
r=rtemp+noise;
r1=r;r2=r;r3=r;r4=r;r5=r;r6=r;r7=r;r8=r;
%CD JUDGE
I1=sum(r1.*pn_seq1);
I2=sum(r2.*pn_seq2);
I3=sum(r3.*pn_seq3);
I4=sum(r4.*pn_seq4);
I5=sum(r5.*pn_seq5);
I6=sum(r6.*pn_seq6);
I7=sum(r7.*pn_seq7);
I8=sum(r8.*pn_seq8);
% DD JUDGE
I=R*[I1I2I3I4I5I6I7I8]‘;
% DD make decision
if(I(1)<0) desion1=-1;
else desion1=1;
end;
if(I(2)<0) desion2=-1;
else desion2=1;
end;
if(I(3)<0) desion3=-1;
else desion3=1;
end;
if(I(4)<0) desion4=-1;
else desion4=1;
end;
if(I(5)<0) desion5=-1;
else desion5=1;
end;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 328 2007-06-03 19:08 MUD\goldseq.m
文件 283 2007-06-03 19:08 MUD\m_sequence.m
文件 5758 2007-06-04 10:43 MUD\mmse.m
文件 3760 2007-06-03 19:08 MUD\sig.m
文件 4790 2007-06-03 19:08 MUD\ddmulti_detect.m
文件 315 2007-06-03 19:08 MUD\gold_seq.m
文件 276 2007-06-03 19:08 MUD\goldcreat.m
目录 0 2007-08-07 16:44 MUD
----------- --------- ---------- ----- ----
15510 8
- 上一篇:两轮自平衡机器人动力学建模及平衡控制
- 下一篇:matlab程序实现.vip
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
评论
共有 条评论