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

📄 iq_mod.m

📁 The result is an IS-95CDMA forward link software simulation package ,which mimics real-time data com
💻 M
字号:
function T_oWave=IQ_mod(walshed,I_PN_state,Q_PN_state)


%IQ modulator
%It carries out the in phase and quadrature phase modulation of the data bit stream which is about to be transmitted from the base station to the. since we are using the forward link communication scheme.

%The walsh code modulated data bit stream enter the IO modulator, and splits into the In phase Stream, which contains the odd number indexed bits and Quadrature phase Stream, which contains the even indexed bits. I and Q pilot PN sequence generator are both 15 stage shift registers

%assign the stage values of I pilot PN sequence generator shift register

Ishift=I_PN_state;


%assign the stage values of Q pilot PN sequence generator shift register

Qshift=Q_PN_state;


%make two arrays to hold the I and Q bit streams of data
%each stream hold a total of 12288 bits
outI=zeros([1,12288]);
outQ=zeros([1,12288]);

%make an array to hold the I+jQ wavefore

oWave1 =zeros([1,12288]);

%seperate the incoming 24576 walsh code modulated data bit stream
for i=1:2:24575
     outI(round(i/2))=walshed(i);
     outQ(round(i/2))=walshed(i+1);
end



%these variables actually holds the actual I and Q signal components of the signal output vector

tranI=zeros([1,12288]);
tranQ=zeros([1,12288]);

%these variables holds the output I and Q pilot PN sequence shift register 

sI=zeros([1,12288]);
sQ=zeros([1,12288]);

%perform modulo-2 addition with the respective PN sequence each stream contains 12288 chips=24576/2 and set data symbol 0->-1 and 1->1

for i=1:12288

  sI(i)=Ishift(15);
  sQ(i)=Qshift(15);
  
  tranI(i)=mod((outI(i)+Ishift(15)),2);
  tranQ(i)=mod((outQ(i)+Qshift(15)),2);

  if tranI(i)==0
      tranI(i)=-1;
  end

  if tranQ(i)==0
      tranQ(i)=-1;
 end

%The I and Q pilot PN sequence generating polynomials
%I=x^15+x^13+x^9+x^8+x^7+x^5+1
%Q=x^15+x^12+x^11+x^10+x^6+x^5+x^4+x^3+1

%we calculate the Q LFSR feedback value

Ifeed=mod((Ishift(15)+Ishift(13)+Ishift(9)+Ishift(8)+ Ishift(7)+Ishift(5)),2);

%then we do it for I

Qfeed=mod((Qshift(15)+Qshift(12)+Qshift(11)+Qshift(10)+Qshift(6)+Qshift(5)+ Qshift(4)+Qshift(3)),2);

%shifting
Ishift(2:15)=Ishift(1:14);
Qshift(2:15)=Qshift(1:14);

%we then perform shifting for the LFSRS
Ishift(1)=Ifeed;
Qshift(1)=Qfeed;

end

%construct the signal output vector, which each element with I and jQ component

for n=1:12288
     oWave1(n)=tranI(n)+tranQ(n)*sqrt(-1);
end

T_oWave=oWave1;



⌨️ 快捷键说明

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