Matlab Explain the codes below % Jake.m % Generate a frequency selective fading function [r, iout, qout] = Jake(idata,...

60.1K

Verified Solution

Question

Electrical Engineering

Matlab

Explain the codes below

% Jake.m

% Generate a frequency selective fading

function [r, iout, qout] = Jake(idata, qdata, nsamp, fs, fc, NN,N1_arr, velocity, counter_arr, delay_time, attn, flat)

%****************************** variables*******************************

% idata input Ich data

% qdata input Qch data

% nsamp Number of samples to be simulated

% fs Sampling frequency (Hz)

% fc Carrier Frequency (Hz)

% NN Number of paths

% N1 Number of waves in order to generate fading

% velocity Mobile speed in Km/h

% counter Fading counter

% delay_time Delay for each fading path (ns)

% attn Attenuation level for different fading paths (dB)

% flat flat fading or not

% r Envelope of fading channel complex impulse response

% iout output Ich data

% qout output Qch data

%************************************************************************

v = velocity./3.6; % m/s

c = 3e8;

fm = fc*v/c; % Maximum doppler frequency (Hz)

delay_samp = round(delay_time.*fs.*1e-9); % normalized delaytime in number of samples

total_attn = sum(10.^(-1.0.*attn./10.0)); % normalize thepower

tstp = 1/fs; % minimum time resolution

iout = zeros(1,nsamp);

qout = zeros(1,nsamp);

r = zeros(1,nsamp);

theta = zeros(1,nsamp);

for i=1:NN

atts = 10.^(-0.05.*attn(i)); % attenuation for current path

  

[itmp, qtmp] = delay(idata, qdata, nsamp, delay_samp(i));

[r_single, iout_single, qout_single] = fade2(itmp, qtmp, nsamp,tstp, fm, N1_arr(i), counter_arr(i), flat);

  

counter_arr = counter_arr+200; % update counter

  

iout = iout + atts.*iout_single./sqrt(total_attn);

qout = qout + atts.*qout_single./sqrt(total_attn);

  

end

r = sqrt(iout.^2+qout.^2);

Answer & Explanation Solved by verified expert
4.1 Ratings (712 Votes)
I give the explaination in Bold and Italic this code genrate gfunction named Jake the input to the functions are idata input Ich data qdata input Qch data nsamp Number of samples to be simulated fs Sampling frequency Hz fc Carrier Frequency Hz NN Number of paths N1 Number of waves in order to generate fading velocity Mobile speed in Kmh counter Fading counter delaytime Delay for each fading path ns attn Attenuation level for    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students