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

📄 multipath_1.m

📁 this simulation talk about simulation multipath rayleigh fading channel
💻 M
字号:
%Simple two path Rayleigh fading channel
%Push F5 to run
%JC-3/27/06
%I would put this under WIRELESS TIPS AND TRICKS AS MULTIPATH. YOU PICK
%YOUR POISON FOR VARIABLES YOU WANT TO USE.
%This m-file uses successive iterations of data to create an animated effect
%showing the results of passing an unmodulated carrier through a simple two
%path Rayleigh fading channel. The following formula and diagram
%illustrates the m-file operation. The animation shows, input(blue)
%and the output(red), the the phase shifts, gains, and attenuations
%of the output sine wave or carrier.
%       L
%r(t)=sum ak(t)*s(t-tauk)    
%       k

%      !------------------Fixed gain-------!
%      !                                   !
%s(t)--!signal in                         Sum--------r(t)signal out
%      !                                   !
%      !---------Delay----Variable gain----!
%                         or attenuation


clear
f_c=1e3;%carrier frequency(no modulation)
time_1 = (linspace (0, 10, 1000));%time
signal_in = sin (2 * pi *f_c* time_1);%sine wave
         
plot (time_1, signal_in, 'b');grid on;%blue=signal_in
xlabel('time');ylabel('amplitude');
title('Rayleigh fading channel with two path sine wave input')
hold on
for ii = 1:10%# iterations
    tau=round(50*rand(1,1)+1);% variable delay(phase shift)
    g1=1;%fixed gain
    g2=round(.5*rand(1,1)+1);%variable gain or attenuation
    signal_out=g1*signal_in + g2*[zeros(1,tau) signal_in(1:end-tau)];

  plot (time_1,(signal_out),'r')%red=signal_out
  pause (2)%~ seconds
end
hold off

⌨️ 快捷键说明

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