Explain what the input variables represent to the following program in MATLAB. f
ID: 3904921 • Letter: E
Question
Explain what the input variables represent to the following program in MATLAB.
function impulse_response=ht_mp_ch(max_delay,L,decay_base,t_step)
t_vector=0:t_step:max_delay;
mp_tmp=0*(t_vector);
path_delays=[0 sort(rand(1,L-1)*max_delay)];
impulse_positions=floor(path_delays/t_step);
mp_tmp(impulse_positions+1)=exp(j*2*pi*rand(1,L));
mp_tmp=mp_tmp.*(decay_base.^(t_vector/max_delay));
impulse_response=mp_tmp/sqrt(sum(abs(mp_tmp).^2));
The program outputs the sampled version of the impulse response hmp(t) of the multipath fading channel as a vector.
Explanation / Answer
Hello Student!
I am happy to help you.
Function - ht_mp_ch(max_delay,L,decay_base,t_step)
Use of max_delay and t_step
These are normal integer values.
It is used for computing t_vector.
If we take a value of 20 for max_delay and 2 for t_step
The t_vector becomes - 0 2 4 6 8 10 12 14 16 18 20
It will form a vector with updation as t_step and max_delay as terminating condition.
Now, for the value of L, it is used for computing path delays. (also an integer value)
For L = 20 and max_delay = 20
Path delays comes out to be - 0 , 3.9319, 4.8705, 5.0217, 5.7168, 6.9997, 7.0332, 9.4658, 10.9945, 11.7053, 12.3209, 16.2857, 16.6166, 18.3439, 18.5853.
These delays will be used for determining the impulse positions.
Now, decay_base.
Now, for mp_tmp it stores exp(j*2*pi*rand(1,L))
Now, the impulse is prone to decay.. For which decay_base is utilised.
For, the value of 5 decay base comes out to be -
-0.8156 + 0.5786i 0.4739 + 1.0748i 0.0870 + 1.3770i -1.4066 + 0.8050i 1.8118 + 0.5843i -2.2324 + 0.1283i
-2.6205 + 0.1772i 0.0000 + 0.0000i 2.9325 - 2.1291i -2.8992 + 3.1168i 0.0000 + 0.0000i
Impulse response for function values - 20, 15, 5, 2 are -
ans =
Columns 1 through 6
0.0649 + 0.1164i -0.0179 - 0.1555i -0.1752 + 0.0558i -0.0620 + 0.2069i -0.0085 - 0.2536i 0.1115 + 0.2763i
Columns 7 through 11
0.0000 + 0.0000i -0.1591 - 0.3791i 0.1959 + 0.4414i -0.3996 - 0.4027i 0.0000 + 0.0000i
Thank you. Feel free to ask anything. Please upvote the answer, if you like it.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.