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

Free

50.1K

Verified Solution

Question

Electrical Engineering

9. The purpose of this problem is to use MATLAB tocompute the magnitude, phase, and total
energy of a Fourier transform.
a) Develop a MATLAB routine to plot the magnitude and phase of agiven 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 selectan appropriate
range of frequencies for these plots. Test your program using thefollowing three
signals for a = 4 (plot all three using the same range offrequencies):
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 findthe approximate
total energy in each of the signals, as well as to find theapproximate frequency ω in
rad/sec below which 90% of the total signal energy iscontained.
c) Suppose you wanted to design a simple low-pass filter with aspecified cutoff
frequency. Assuming that you could choose the desired value of aand based on the
total energy criterion alone, which impulse response would youchoose? Why?

Answer & Explanation Solved by verified expert
3.6 Ratings (421 Votes)

%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


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