Question

In: Electrical Engineering

9. The purpose of this problem is to use MATLAB to compute the magnitude, phase, and...

9. The purpose of this problem is to use MATLAB to compute the magnitude, phase, and total
energy of a Fourier transform.
a) Develop a MATLAB routine to plot the magnitude and phase of a given Fourier
transform H(jω). The input part of your program will, of course, require that you
specify the particular H(jω) of interest, but, once this is done, your program should not
depend on the Fourier transform specified. You will need to select an appropriate
range of frequencies for these plots. Test your program using the following three
signals for a = 4 (plot all three using the same range of frequencies):
i) h(t) = e-at u(t)
ii) h(t) = e-a|t|
iii) h(t) = te-at u(t)
b) Extend the MATLAB routine that you developed in part a) to find the approximate
total energy in each of the signals, as well as to find the approximate frequency ω in
rad/sec below which 90% of the total signal energy is contained.
c) Suppose you wanted to design a simple low-pass filter with a specified cutoff
frequency. Assuming that you could choose the desired value of a and based on the
total energy criterion alone, which impulse response would you choose? Why?

Solutions

Expert Solution

%Part a Solution

clc;
clear all;
close all;
a=4;
F=50;
t = 0:1/F:10-1/F; %time instant
signal_1=exp(-a.*t);%signal 1
signal_2=exp(-a*(abs(t)));%signal 2
signal_3=t.*exp(-a.*t);%signal 3
Ts=mean(diff(t));
Fs=1/Ts;
%%Choose the signal
signal=signal_1;
a = fft(signal); %fourier transform of signal 1
freq = (0:length(a)-1)*50/length(a); %frequency
l = length(signal);
fshift = (-l/2:l/2-1)*(50/l);
yshift = fftshift(a);%for two sided spectrum
plot(fshift,abs(yshift))
title('Magnitude')
power = abs(yshift).^2/l;
plot(fshift,power)
title('Power')
phase=angle(yshift); %phase
%%Part b Solution
y_squared=abs(yshift);
Et=sum(y_squared)*Fs/l;%total energy
Eg=0.9*(Et);% 90 % of the total energy
df = Fs/l; % frequency increment
for i=1:500
E(i)=sum(y_squared(1:i))*Fs/l;
end
for i=1:500
if E(i)<=Eg;
out = i;
end
end
freq_Hz=(50/500)*out;%frequency in Hz.

%%Part c Solution

To design a simple low pass filter with a specified cut off frequency based on the total energy criterian alone we will  choose the third signal because the impulse response of third signal has the highest cut-off frequency


Related Solutions

H(s)G(s) = 30(s+2)/(s^3+7s^2+12s) In MATLAB, Use the function margin to plot log-magnitude, phase, gain margin, phase...
H(s)G(s) = 30(s+2)/(s^3+7s^2+12s) In MATLAB, Use the function margin to plot log-magnitude, phase, gain margin, phase margin. Do not use the function bode. I graphed it using margin, but how do I just get the phase? I got the gain margin, phase margin, and the cross over frequencies. Thanks
USING MATLAB Q2. Determine and plot the frequency response function H(e^jw) (magnitude and phase normalized in...
USING MATLAB Q2. Determine and plot the frequency response function H(e^jw) (magnitude and phase normalized in w). Choose n = [-20, 20]. 1. h(n) = (0.9)^│n│ 2. h(n) = [ (0.5)^n + (0.4)^n] u(n) USING MATLAB
in Matlab, Use the Monte Carlo analysis to compute the area of a circle with radius...
in Matlab, Use the Monte Carlo analysis to compute the area of a circle with radius 1. print out your code, at least one figure on which the circle and ‘dart hits’ are shown, and numerical results for N=10, 100,1000. For each N, repeat the calculation at least 5times.
Use the switch structure to write a MATLAB program to compute the amount of money that accumulates
Use the switch structure to write a MATLAB program to compute the amount of money that accumulates in a savings account in one year. The program should accept the following input: the initial amount of money deposited in the account; the frequency of interest compounding (monthly, quarterly, semiannually, or annually); and the interest rate. Run your program for a $1000 initial deposit for each case; use a 5 percent interest rate. Compare the amounts of money that accumulate for each...
Suppose that x = -7 - 5i and y = 4 + 3i. Use MATLAB to compute
Suppose that x = -7 - 5i and y = 4 + 3i. Use MATLAB to compute a. x + y b. xy c. x/y    
Is there a solution for this anywhere?  Chapter 9, Problem 16P, 5th edition, Matlab for engineers
Is there a solution for this anywhere?  Chapter 9, Problem 16P, 5th edition, Matlab for engineers
Problem 1. The purpose of this problem is to practice the use of logic operations and...
Problem 1. The purpose of this problem is to practice the use of logic operations and quantifiers. For each Statement X below determine if each of the three statementsX1, X2, X3 that follow it satisfy the following: a) Xi implies X; b) X implies Xi; c) if Xi is true then X must be false; d) if X is true then Xi must be false. Statement A. In every house there is a mouse. A1. There is no house without...
The magnitude of the liquid-phase diffusivity is much smaller than that of the gas-phase diffusivity -justify...
The magnitude of the liquid-phase diffusivity is much smaller than that of the gas-phase diffusivity -justify the steatment...
Use MATLAB to figure out the following problem, if you do not know how to use...
Use MATLAB to figure out the following problem, if you do not know how to use MATLAB then please do not answer. Coding is required for the exercise. For f(x) = arctan(x), find its zeros by implimenting Newtons method and the Secant method in Matlab. (Hint: Use Newtons method to calculate x1 for Secant method) Comment all code please since I would like to learn how to do this correctly in MATLAB. Thank you.
Problem 4 ..... you can use Matlab Using the same initial code fragment as in Problem...
Problem 4 ..... you can use Matlab Using the same initial code fragment as in Problem 1, add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the impulse response of an IIR bandstop filter with band edge frequencies 750 Hz and 850 Hz and based on a 4th order Butterworth prototype. Name your program p3.sce the below is the Problem 1 initail code .. you can use it Matlab The following cilab code generates a 10-second “chirp”...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT