Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

please help. here is my code but my professor said" it was not intended to start with the sinc function to generate the plots. Should define the rectangular pulse in the time domain and then perform the fft on that." Please fix my code:

close all;
clear;

% Frequency range and increment for graph
f = -0.3:0.001:0.3;

% Establishing values for Tau and Fourier Transform functions
T1 = 5;
x1 = pi * f * T1;
M1 = (T1 * sin(x1)) ./ x1;

T2 = 10;
x2 = pi * f * T2;
M2 = (T2 * sin(x2)) ./ x2;

T3 = 25;
x3 = pi * f * T3;
M3 = (T3 * sin(x3)) ./ x3;


M1(isnan(M1)) = T1;
M2(isnan(M2)) = T2;
M3(isnan(M3)) = T3;

% Perform FFT and FFT shift for each signal
F1 = fftshift(fft(M1));
F2 = fftshift(fft(M2));
F3 = fftshift(fft(M3));

% Plot magnitude of the signals
figure(1)
plot(f, abs(M1), 'c', f, abs(M2), 'b', f, abs(M3), 'm');
xlabel('Frequency (Hz)');
ylabel('|x(f)|');
title('Magnitude Plot of Fourier Transform of x(t)');

% Plot phase using FFT and FFT shift
figure(2)
plot(f, rad2deg(angle(F1)), 'c', ...
f, rad2deg(angle(F2)), 'b', ...
f, rad2deg(angle(F3)), 'm');
xlabel('Frequency (Hz)');
ylabel('Phase (degrees)');
title('Phase Plot after FFT and FFT Shift');

Thank you I will like
Transcribed Image Text:b) Create the magnitude plot and phase plot of the spectra (Fourier Transform) for t = 5, 10, 25 [seconds]. In other words, overlap three magnitude curves for t = 5, 10, 25 in one plot; and overlap three phase curves for t = 5, 10, 25 in the other plot.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education