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

📄 channel.m

📁 The result is an IS-95CDMA forward link software simulation package ,which mimics real-time data com
💻 M
字号:

function multipaths =Channel(T_oWave,SNR,numpaths)
 
%This is communication channel of the system.

%first we will declare the structure of a signal
signal=struct('data',{[]},'distance',{[]});

%create the propagation path distance for 1 chip delay
wlength =(3*10^8)*(813*10^-9);

%create a vector to hold all multipath signals
multipaths1=[]; 

%create 5 reflective channel objects with different amplitude gains
objects =zeros([1,5]);
objects =[0.2  0.5  0.6  0.3  0.7];

if numpaths~=0
    infected = Interference(T_oWave,numpaths);
end

%create 5 multipaths
for i=1:5

 multipaths1=[multipaths1 signal];

  %each multipath have a different propagation delay differed by 1 chip delay
  %propagation distance
 multipaths1(i).distance=3000+(wlength*(i-1));

 tempD=multipaths1(i).distance;

pLoss =((3*10^8/(8.69*10^8))/(4*pi*tempD))^2;


%power of the received signal after reflection +path loss

tempP=T_oWave*pLoss*objects(i);
 
 for k=1:length(T_oWave)

  %add AWGN
  %SNR will determine the mean mn

pr=(real(tempP(k)))^2+(imag(tempP(k)))^2;
mn=sqrt(pr/(2*SNR));

 
   if numpaths==1
    mn =sqrt((mn^2)/2);
   end
  
   if numpaths==3
    mn =sqrt((mn^2)/4);
   end

    if numpaths==5
    mn =sqrt((mn^2)/6);
    end

    Anosie=mn*((randn)+(randn*sqrt(-1)));

    tempP(k)=tempP(k)+Anosie;

    if numpaths~=0
     %add in another userˇs signal
    tempP(k)=tempP(k)+(mn*infected(k));

    end

 end
 %power of the signal after reflection+path loss+AWGN
 multipaths1(i).data=tempP;

end

multipaths=multipaths1;

⌨️ 快捷键说明

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