• m基于matlab的TDSCDMA系统性能仿真


    目录

    1.算法概述

    2.仿真效果预览

    3.核心MATLAB代码预览

    4.完整MATLAB程序


    1.算法概述

            TD-SCDMA的中文含义为时分复用同步码分多址接入,是由中国第一次提出、在无线传输技术(RTT)的基础上完成并已正式成为被ITU接纳的国际移动通信标准。这是中国移动通信界的一次创举和对国际移动通信行业的贡献,也是中国在移动通信领域取得的前所未有的突破 。
            TD-SCDMA中的TD指时分复用,也就是指在TD-SCDMA系统中单用户在同一时刻双向通信(收发)的方式是TDD(时分双工),在相同的频带内在时域上划分不同的时段(时隙)给上、下行进行双工通信,可以方便地实现上、下行链路间的灵活切换。例如根据不同的业务对上、下行资源需求的不同来确定上、下行链路间的时隙分配转换点,进而实现高效率地承载所有3G对称和非对称业务。与FDD模式相比,TDD可以运行在不成对的射频频谱上,因此在当前复杂的频谱分配情况下它具有非常大的优势。TD-SCDMA通过最佳自适应资源的分配和最佳频谱效率,可支持速率从8kb/s到2Mb/s以及更高速率的语音、视频电话、互联网等各种3G业务 

           TD-SCDMA的发展始于1998年初,当时在国家邮电部的直接领导下,由原电信科学技术研究院组织队伍在 SCDMA技术的基础上,研究和起草符合IMT-2000要求的TDSCDMA建议草案。该标准草案以智能天线、同步码分多址、接力切换、时分双工为主要特点,于ITU征集IMT-2000第三代移动通信无线传输技术候选方案的截止日1998年6月30日提交到ITU,从而成为IMT2000的15个候选方案之一。ITU综合了各评估组的评估结果。在1999年11月举行的赫尔辛基ITU-RTG8/1第18次会议上和2000年5月举行的伊斯坦布尔ITU-R全会上,TD-SCDMA被正式接纳为CDMATDD制式的方案之中国无线通信标准研究组(CWTS)作为代表中国的区域性标准化组织,自1999年5月加入3GPP后,经过4个月的充分准备,与项目协调组(3 GPPPCG)、技术规范组(TSG)进行了大量协调工作,在同年9月向3GPP建议将TD- SCDMA纳入3GPP标准规范的工作内容。1999年12月在法国尼斯举行的3GPP会议上,提案被无线接入网(3 GPPTSGRAN)全会所接受,正式确定将TD- SCDMA纳入 Release200(后拆分为R4和R5)的工作计划中,并将 TD-SCDMA简称为即低码片速率TDD方案(Low Code rate, LCRTDD) [4]  。

    在TD-SCDMA系统中,用到了以下几种主要关键技术 :
    (1)时分双工方式(Time Division Duplexing);
    (2)联合检测(Joint Detection);
    (3)智能天线(Smart Antenna);
    (4)上行同步(Uplink Synchronous);
    (5)软件无线电(Soft Radio);
    (6)动态信道分配(Dynamic Channel Allocation);
    (7)功率控制(Power control);
    (8)接力切换(Baton Handover);
    (9)高速下行分组接入技术(High Speed Downlink Packet Access)  。
     

    2.仿真效果预览

    matlab2022a仿真测试如下:

     

     

    3.核心MATLAB代码预览

    1. snr_indb=1:8;
    2. for k=1:length(snr_indb)
    3. snr=10^(snr_indb(k)/10);
    4. sgma=1;
    5. eb=2*(sgma^2)*snr;
    6. LC=31;
    7. echip=eb/LC;
    8. N=1000;%number of bits transmitted
    9. %creat PN codes
    10. fbconnection=[0 1 0 0 1];
    11. mseq=m_sequence(fbconnection);
    12. fbconnection1=[0 0 1 0 1];
    13. fbconnection2=[0 1 1 1 1];
    14. goldseq=gold_seq(fbconnection1,fbconnection2);
    15. %N=2^length(fbconnection)-1;
    16. ind1=find(mseq==0);
    17. mseq(ind1)=-1;
    18. ind2=find(goldseq==0);
    19. goldseq(ind2)=-1; %creat 31*31 gold sequence
    20. temp=goldseq;
    21. pn_seq1=temp(3,:);
    22. pn_seq2=temp(4,:);
    23. pn_seq3=temp(7,:);
    24. pn_seq4=temp(10,:);
    25. pn_seq5=temp(15,:);
    26. pn_seq6=temp(20,:);
    27. pn_seq7=temp(26,:);
    28. pn_seq8=temp(31,:);
    29. % comput matrix R
    30. pp=[pn_seq1;pn_seq2;pn_seq3;pn_seq4;pn_seq5;pn_seq6;pn_seq7;pn_seq8];
    31. RR=(1/LC)*pp*pp';
    32. RR1=inv(eb*eye(8));
    33. R=inv(RR+RR1);
    34. %generate codes
    35. for i=1:N
    36. temp1=rand;
    37. if(temp1<0.5),dsource1(i)=-1;
    38. else dsource1(i)=1;
    39. end;
    40. temp2=rand;
    41. if(temp2<0.5),dsource2(i)=-1;
    42. else dsource2(i)=1;
    43. end;
    44. temp3=rand;
    45. if(temp3<0.5),dsource3(i)=-1;
    46. else dsource3(i)=1;
    47. end;
    48. temp4=rand;
    49. if(temp4<0.5),dsource4(i)=-1;
    50. else dsource4(i)=1;
    51. end;
    52. temp5=rand;
    53. if(temp5<0.5),dsource5(i)=-1;
    54. else dsource5(i)=1;
    55. end;
    56. temp6=rand;
    57. if(temp6<0.5),dsource6(i)=-1;
    58. else dsource6(i)=1;
    59. end;
    60. temp7=rand;
    61. if(temp7<0.5),dsource7(i)=-1;
    62. else dsource7(i)=1;
    63. end;
    64. temp8=rand;
    65. if(temp8<0.5),dsource8(i)=-1;
    66. else dsource8(i)=1;
    67. end;
    68. end;
    69. number_of_err=0;
    70. number_of_err1=0;
    71. number_of_err2=0;
    72. for i=1:N
    73. %将每个bit repeat LC=31 times
    74. for j=1:LC
    75. repeatdata1(j)=dsource1(i);
    76. repeatdata2(j)=dsource2(i);
    77. repeatdata3(j)=dsource3(i);
    78. repeatdata4(j)=dsource4(i);
    79. repeatdata5(j)=dsource5(i);
    80. repeatdata6(j)=dsource6(i);
    81. repeatdata7(j)=dsource7(i);
    82. repeatdata8(j)=dsource8(i);
    83. end;
    84. for ii=0:2^8-1
    85. j=1;aa=ii;
    86. while aa~=0
    87. bk(j,ii+1)=rem(aa,2);
    88. aa=floor(aa/2);
    89. j=j+1;
    90. end
    91. end
    92. bk=bk*2-1;
    93. %tranmit signal is:
    94. trans_sig1=sqrt(echip)* repeatdata1.*pn_seq1;
    95. trans_sig2=sqrt(echip)* repeatdata2.*pn_seq2;
    96. trans_sig3=sqrt(echip)* repeatdata3.*pn_seq3;
    97. trans_sig4=sqrt(echip)* repeatdata4.*pn_seq4;
    98. trans_sig5=sqrt(echip)* repeatdata5.*pn_seq5;
    99. trans_sig6=sqrt(echip)* repeatdata6.*pn_seq6;
    100. trans_sig7=sqrt(echip)* repeatdata7.*pn_seq7;
    101. trans_sig8=sqrt(echip)* repeatdata8.*pn_seq8;
    102. %add AWGN noise
    103. noise=sgma*randn(1,LC);
    104. % receive signal
    105. for j=1:LC
    106. 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);
    107. end;
    108. r=rtemp+noise;
    109. r1=r;r2=r;r3=r;r4=r;r5=r;r6=r;r7=r;r8=r;
    110. %CD JUDGE
    111. I1=sum(r1.*pn_seq1);
    112. I2=sum(r2.*pn_seq2);
    113. I3=sum(r3.*pn_seq3);
    114. I4=sum(r4.*pn_seq4);
    115. I5=sum(r5.*pn_seq5);
    116. I6=sum(r6.*pn_seq6);
    117. I7=sum(r7.*pn_seq7);
    118. I8=sum(r8.*pn_seq8);
    119. % DD JUDGE
    120. I=R*[I1,I2,I3,I4,I5,I6,I7,I8]';
    121. y=[I1,I2,I3,I4,I5,I6,I7,I8]';
    122. for ii=1:2^8
    123. c(ii)=2*(bk(:,ii))'*y-(bk(:,ii))'*R*bk(:,ii);
    124. end
    125. [m,mm]=max(c);
    126. bb=bk(:,mm);
    127. if(bb(1)~=dsource1(i)),number_of_err2=number_of_err2+1;end;
    128. if(bb(2)~=dsource2(i)),number_of_err2=number_of_err2+1;end;
    129. if(bb(3)~=dsource3(i)),number_of_err2=number_of_err2+1;end;
    130. if(bb(4)~=dsource4(i)),number_of_err2=number_of_err2+1;end;
    131. if(bb(5)~=dsource5(i)),number_of_err2=number_of_err2+1;end;
    132. if(bb(6)~=dsource6(i)),number_of_err2=number_of_err2+1;end;
    133. if(bb(7)~=dsource7(i)),number_of_err2=number_of_err2+1;end;
    134. if(bb(8)~=dsource8(i)),number_of_err2=number_of_err2+1;end;
    135. % DD make decision
    136. if(I(1)<0), desion1=-1;
    137. else desion1=1;
    138. end;
    139. if(I(2)<0), desion2=-1;
    140. else desion2=1;
    141. end;
    142. if(I(3)<0), desion3=-1;
    143. else desion3=1;
    144. end;
    145. if(I(4)<0), desion4=-1;
    146. else desion4=1;
    147. end;
    148. if(I(5)<0), desion5=-1;
    149. else desion5=1;
    150. end;
    151. if(I(6)<0), desion6=-1;
    152. else desion6=1;
    153. end;
    154. if(I(7)<0), desion7=-1;
    155. else desion7=1;
    156. end;
    157. if(I(8)<0), desion8=-1;
    158. else desion8=1;
    159. end;
    160. if(desion1~=dsource1(i)),number_of_err=number_of_err+1;end;
    161. if(desion2~=dsource2(i)),number_of_err=number_of_err+1;end;
    162. if(desion3~=dsource3(i)),number_of_err=number_of_err+1;end;
    163. if(desion4~=dsource4(i)),number_of_err=number_of_err+1;end;
    164. if(desion5~=dsource5(i)),number_of_err=number_of_err+1;end;
    165. if(desion6~=dsource6(i)),number_of_err=number_of_err+1;end;
    166. if(desion7~=dsource7(i)),number_of_err=number_of_err+1;end;
    167. if(desion8~=dsource8(i)),number_of_err=number_of_err+1;end;
    168. %CD MAKE DECISION
    169. % CD make decision
    170. if(I1<0), desion11=-1;
    171. else desion11=1;
    172. end;
    173. if(I2<0), desion21=-1;
    174. else desion21=1;
    175. end;
    176. if(I3<0), desion31=-1;
    177. else desion31=1;
    178. end;
    179. if(I4<0), desion41=-1;
    180. else desion41=1;
    181. end;
    182. if(I5<0), desion51=-1;
    183. else desion51=1;
    184. end;
    185. if(I6<0), desion61=-1;
    186. else desion61=1;
    187. end;
    188. if(I7<0), desion71=-1;
    189. else desion71=1;
    190. end;
    191. if(I8<0), desion81=-1;
    192. else desion81=1;
    193. end;
    194. if(desion11~=dsource1(i)),number_of_err1=number_of_err1+1;end;
    195. if(desion21~=dsource2(i)),number_of_err1=number_of_err1+1;end;
    196. if(desion31~=dsource3(i)),number_of_err1=number_of_err1+1;end;
    197. if(desion41~=dsource4(i)),number_of_err1=number_of_err1+1;end;
    198. if(desion51~=dsource5(i)),number_of_err1=number_of_err1+1;end;
    199. if(desion61~=dsource6(i)),number_of_err1=number_of_err1+1;end;
    200. if(desion71~=dsource7(i)),number_of_err1=number_of_err1+1;end;
    201. if(desion81~=dsource8(i)),number_of_err1=number_of_err1+1;end;
    202. end
    203. err(k)=number_of_err/(3*N)%MMSE ber
    204. err1(k)=number_of_err1/(3*N)%CD ber
    205. err2(k)=number_of_err2/(3*N)
    206. end
    207. %plot(snr_indb,err);
    208. semilogy(snr_indb,err,'k');%MMSE ber
    209. grid on;
    210. hold on;
    211. semilogy(snr_indb,err1,'r');%CD ber
    212. hold on
    213. semilogy(snr_indb,err2,'^-')
    214. legend('MMSE','CD','不加信道估计');
    215. 01_006_m

    4.完整MATLAB程序

    matlab源码说明_我爱C编程的博客-CSDN博客

    V

  • 相关阅读:
    pytorch文本分类(一):文本预处理
    spring源码解析——IOC之自定义标签解析
    运营商大数据精准营销获客?
    《C++ primer》练习6.36-6.38:书写返回数组引用的函数声明
    一台服务器成了哆啦A梦的神奇口袋
    第八章 文本数据
    坑爹,线上同步近 3w 个用户导致链路阻塞引入发的线上问题,你经历过吗?
    Android App links 链接打开app功能
    【预约观看】Ambire 智能钱包 AMA 活动第四期即将举行
    关于栈帧的一些知识点与理解
  • 原文地址:https://blog.csdn.net/hlayumi1234567/article/details/127892581