⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t_long_pn.m

📁 The result is an IS-95CDMA forward link software simulation package ,which mimics real-time data com
💻 M
字号:
function T_PN_out=T_Long_PN(Start_state)

%This is the Long PN sequence Generator at the Transmitter
%It produces a total of 24576  PN chips for processing every 20ms data frame.

%The PN Long Code generating polynomial is
%G(x)=x^42+x^35+x^33+x^31+x^27+x^26+x^25+x^22+x^21+x^19+x^18+x^17+x^16+x^10+x^7+x^6+x^5+x^3+x^2+x^1+1

%assign the stage values of Long PN sequence generator shift register
gshift=Start_state;

%we now declare a variable for holding the PN output
T_PN_out1=zeros([1,24576]);

%The output from the Long Code Generator is 1.2288Mcps
%Therefore for every 20ms data frame, the LFSR(Liner Feedback Shift Register iterates 24576 times(1.2288Mcps/50)

for i=1:24576
 
  %obtain PN chip from output of shift register 
  T_PN_out1(i)=gshift(42);

  %we set the initial feedback value to be x^1
  gfeed=gshift(1);

  gfeed=mod((gfeed+gshift(42)+gshift(35)+gshift(33)+gshift(31)+gshift(27)+gshift(26)+gshift(25)+gshift(22)+gshift(21)+gshift(19) +gshift(18)+gshift(17)+gshift(16)+gshift(10)+gshift(7)+gshift(6) +gshift(5)+gshift(3)+gshift(2)+gshift(1)),2);

  %the state of the current stage shift register is replaced by the state of the previous stage shift register 2 to 42

  gshift(2:42)=gshift(1:41);

  %the first stage shift register receives the feedback vaule
  gshift(1)=gfeed;

end

T_PN_out=T_PN_out1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -