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

📄 wireless_dl.m

📁 无线信道中下行链路,用MATLAB进行仿真
💻 M
字号:
%
% filename: wireless_DL.m
%
% function: simulating the DownLink wireless channel (multi-path & rayleigh).
% 
% - BS_send_signal: (Ka,7040)
% - UE_receive_signal: (K_user,7040)
%
% wangym, 9th,JAN.,2001
%
function UE_receive_signal = wireless_DL(BS_send_signal)

%define the global variable
global TS_clock
global vc_table

global condition_basic
global condition_BS
global condition_UE
global condition_multipath
global condition_rayleigh

%read vc_table    
K_vc = vc_table(17,1);	?					% number of assigned VCs
K_user = vc_table(17,2);					% number of assigned users
%get the number of multipath for a user
N_multi=size(condition_multipath,1);
%get the number of antennas in BS 
Ka = condition_basic(1);
Sigma = condition_basic(4);

%get the length of signal 
s_length = size(BS_send_signal,2);


UE_receive_signal = zeros(K_user,s_length);?
for ku=1:K_user
   for n=1:N_multi
      
      % calculate the signal along the direction of n multipath of ku user
      %path direction
      path_angle = condition_multipath(n,4,?ku)*pi/180;				    	%(radian)
      % path_weight
      %circular array
      r_lamda=0.6;?
      ant_angle?=[0 pi/4 pi/2 pi*3/4 pi pi*5/4 pi*3/2 pi*7/4];
      path_weight = zeros(Ka,1);?
      for ka=1:Ka
         temp=2*pi*r_lamda*(1-cos(path_angle-ant_angle(ka)));
         path_weight(ka,1)=cos(temp)+j*sin(temp);
      end
      %conjugate transposition
      downlink_weight=path_weight';
      signal0=downlink_weight*BS_send_signal;					% (1,7040)
      
      %path delay							%(1 chip = 781.25ns) (1/8 chip = 97.65625ns)
      path_delay = round?(condition_multipath(n,1,ku)/97.65625);				%1/8 chip
      signal1 = zeros(1,s_length);
      signal1(path_delay+1:s_length) ?= signal0(1:(s_length-path_delay));
      
      % path attenuation
      path_weight = 10^(condition_multipath(n,2,ku)/10);			%true value(not dB)
      signal2 = signal1 * sqrt(path_weight);
      
      %path phase shift
      path_phase = condition_multipath(n,3,ku);				    	%(radian)
      signal3 = signal2 * exp(j*path_phase);
      
      %rayleigh fading
      Speed = condition_basic(3) ;
      if Speed ~= 0
         multipath_ID = [ku,n];
         %envelope=rayleigh_fading(multipath_ID);
         envelope=rayleigh_fading(multipath_ID)*lognormal(multipath_ID, Sigma);
      else
         envelope=ones(1,s_length);?
      end
      UE_receive_signal(ku,:)=UE_receive_signal(ku,:)+envelope.*signal3;
   end
   %normalized by the total multipath power
   PW(1:N_multi) = 10.^(condition_multipath(1:N_multi,2,ku)/10);	%true value(not dB)
   total_power=sum(PW);
   %total_power=1;
   UE_receive_signal(ku,:)=UE_receive_signal(ku,:)/sqrt(total_power);?
end

⌨️ 快捷键说明

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