irtsv3.m

来自「Impulse Response in Rayleigh Fading chan」· M 代码 · 共 63 行

M
63
字号
% irtf(v=3).m
%
% impulse response
%
%****************************************************
% idata : Input Ich data     
% qdata : Input Qch data     
% iout  : Output Ich data
% qout  : Output Qch data
% ramp  : Amplitude contaminated by fading
% itau  : Delay time for each multipath fading
% dlvl  : Attenuation level for each multipath fading
% no    : Number of waves in order to generate fading (Number of oscillator)
% itn   : Fading counter for each multipath fading
% n1    : Number of summation for direct and delayed waves 
% nsamp : Total number of symbols
% tstp  : Mininum time resolution
% fd    : Maximum doppler frequency
% flat  : Flat fading or not 
% (1->flat (only amplitude is fluctuated),0->normal(phase and amplitude are
% fluctutated)
%****************************************************

%**************** Set Parameters ********************
clear all;

nsamp=100;
idata=zeros(1,nsamp);
qdata=zeros(1,nsamp);
idata(1,1)=1;

v=3;                             % v: speed of MS (km/h)
fs=1e7;
tstp=1/fs;
n1=4;
itau=[0,110*10^(-9)/tstp,190*10^(-9)/tstp,410*10^(-9)/tstp];
dlvl=[0,9.7,19.2,22.8];
no=[16,16,16,16];
itn=[1000,2000,3000,4000];
flat=1;
fd=dosp(v);                      % Calculate maximum Doppler frequency
%**************** Impulse Reponse *******************
[iout,qout,ramp,rev]=sefade(idata,qdata,itau,dlvl,no,itn,n1,nsamp,tstp,fd,flat)
iout=20*log10(rev);

figure;clf;stem(0:length(iout)-1,iout-max(iout));grid on
xlabel('Time Delay');
ylabel('Amplitude(dB)');
title('Impulse Response (Vped=3km/h)');
%**************** Transfer Function *****************
tf = fft(rev);
%tf = 10.*log10(tf.*conj(tf));
tf = 20.*log10(abs(tf));

figure;clf;plot(0:1/(length(tf)-1):1,tf);grid on
title('Transfer Function (Vped=3km/h)');
xlabel('Frequency(rad)');
ylabel('Transfer Function(dB)'); 
%***************** end of file ******************* 



⌨️ 快捷键说明

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