Question

In: Electrical Engineering

Consider the user-defined MATLAB function below, ht_mp_ch(). The function ht_mp_ch(), outputs the sampled version of the...

Consider the user-defined MATLAB function below, ht_mp_ch().
The function ht_mp_ch(), outputs the sampled version of the impulse response hmp(t) of the multipath fading channel as a vector.


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));


Explain what the variable on the left-hand side represents and justify how the right-hand side expression is formulated by adding comments to every line.

Solutions

Expert Solution

The above given code in MATLAB which defines and represents as follows:

ht_mp_ch() is a syntax code which is written for a variable

ht_mp_ch() is a variable in which// ht_ denotes a vector and mp_ denotes multipath and ch_ represents channel. in other words it is a multipath fading channel vector.

function impulse_response=ht_mp_ch(max_delay,L,decay_base,t_step)

//The above function represents on impulse function plotting graph = multipath fading vector what is the maximum delay time to be set and decay base time and unit step time and total length L

t_vector=0:t_step:max_delay;

//for each step giving or setting maximum delay

impulse_positions=floor(path_delays/t_step)

//for plotting impulse function the positions setting with path delays with step by step

mp_tmp(impulse_positions+1)=exp(j*2*pi*rand(1,L));

//this represents based on which exponential values it has to increase and decrease the value for multipath in a maximum length L

mp_tmp=mp_tmp.*(decay_base.^(t_vector/max_delay));

// it is a decay base means the value where it has to decrease the graph and the vector to maximum delay value

impulse_response=mp_tmp/sqrt(sum(abs(mp_tmp).^2));

//the above is the final plotting graph in impulse by using the above formula


Related Solutions

MATLAB Write a user defined function for a projectile motion. If a ball is launched from...
MATLAB Write a user defined function for a projectile motion. If a ball is launched from initial position(0,0) with a velocity v0 at angle θ, determine your horizontal and vertical position. Please plot x vs. t, y vs. t and y vs. x.
MATLAB Program a Matlab version of Guess the Word. The word should be determined by user...
MATLAB Program a Matlab version of Guess the Word. The word should be determined by user input. Once the word is determined, the game should begin by displaying blanks (-) where all the letters of the word are. The game should then continue to prompt the player to guess a letter in the word. If the player guesses a letter that is in the word and not already displayed, that letter should be displayed everywhere it appears in the word....
Please solve the following problem for MATLAB Write a user-defined function that calculates the average and...
Please solve the following problem for MATLAB Write a user-defined function that calculates the average and the standard deviation of a list of numbers. Use the function to calculate the average and the standard deviation of the following list of grades : 80 75 91 60 79 89 65 80 95 50 81
Please solve the following problem for MATLAB Write a user-defined function (name it F to C)...
Please solve the following problem for MATLAB Write a user-defined function (name it F to C) that converts temperature in degrees F to temperature in degrees C. Use the function to solve the following problem. The change in the length of an object, ∆L, due to a change in the temperature, ∆T, is given by: ∆L = αL∆T, where a is the coefficient of thermal expansion. Determine the change in the area of a rectangular(4.5 m by 2.25m) aluminum (α=23·10-61/˚C)...
Write a user-defined MATLAB function, with two input and two output arguments that determines the height...
Write a user-defined MATLAB function, with two input and two output arguments that determines the height in centimeters (cm) and mass in kilograms (kg)of a person from his height in inches (in.) and weight in pounds (lb). (a) Determine in SI units the height and mass of a 5 ft.15 in. person who weight 180 lb. (b) Determine your own height and weight in SI units.
Write a user-defined MATLAB function that converts real numbers in decimal form to binary form. Name...
Write a user-defined MATLAB function that converts real numbers in decimal form to binary form. Name the function b = deciTObina (d), where the input argument d is the number to be converted and the output argument b is a 30-element-long vector with 1s and 0s that represents the number in binary form. The first 15 elements of b store the digits to the left of the decimal point, and the last 15 elements of b store the digits to...
Write a user defined MATLAB program that performs power factor correction. The inputs to the MATLAB...
Write a user defined MATLAB program that performs power factor correction. The inputs to the MATLAB function should be voltage across the load (in Vrms, assume 0 phase), frequency Resistance of the load Inductance of the load power factor of the load target power factor The output of the function should be the size of the capacitor that one would need to place in parallel with the load to reach the target power factor. Please submit the code for the...
Write a user-defined MATLAB function that uses classical fourth order Runge-Kutta method to solve a first...
Write a user-defined MATLAB function that uses classical fourth order Runge-Kutta method to solve a first order ODE problem dydx = f(x, y) in a given interval a ? x ? b with initial condition y(a) = y0 and step size of h. For function name and arguments, use [x,y] = myrk4(f, a, b, h, y0) Check your function to find the numerical solution for dydx=?1.2y+7e^(?0.3x) in the interval 0 ? x ? 4 with initial condition y(0)=3. Run your...
The function Sine is defined as: where x is an angle in radians Write a Matlab...
The function Sine is defined as: where x is an angle in radians Write a Matlab script program to compute the sinus value of any angle as the following: - The program should run always until the user enters - 1 to exit from the program. - A sk user to enter: Number of elements (N) that should be included in the sum - C heck that N is a positive integer . [ Hint: use ( round (N) -...
(Using Matlab) and "while" function 1.   Write a program that prompts the User for if they...
(Using Matlab) and "while" function 1.   Write a program that prompts the User for if they would like to enter a real number. If yes, prompt the User for the real number. Continue to do this until the User enters “no” to the first question. After the User enters “no”, display the average of all the numbers entered. (Using Matlab) and "while" function 2.   Write a program that prompts the User for if they would like to enter a real...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT