Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use the following MATLAB code to generate x(t) clear all close all clc t = linsp

ID: 2082277 • Letter: U

Question

Use the following MATLAB code to generate x(t) clear all close all clc t = linspace(-2, 2); x = 5(heaviside(t + 1)- Heaviside (t - 1)); plot(t, x) axis ((-2 2 -1 2]); a. Continue coding and use 'fft command to take the Fourier transform of the x(t). Plot |X(w) |. b. Compute the Fourier transform of this signal by hand and compare your results with the answer from MATLAB. c. Modulate x(t) with a carrier frequency of 100 MHz (AM modulation). Plot the magnitude of the frequency domain representation of the modulated signal. Use the modulation example for F.T. to explain your output.

Explanation / Answer

clear all;
close all;
clc;
t = linspace(-2,2);
x = 5*(heaviside(t+1)-heaviside(t-1));
plot(t,x)
axis([-2 2 -1 2])
Y = fft(x);
P = abs(Y);
f = 1:100;
stem(f,P)
ylabel('FFT magnitude')
xlabel('Frequency (Hz)')
fc = 100e+6;
t1 = 0:0.001:100;
x1 = sin(2*pi*t1);
Modsig = ammod(x1,fc,x);
plot(t,Modsig)
f = 1:100
stem(f,P)
ylabel('FFT magnitude')
xlabel('Frequency (Hz)')
fc = 100e+6;
t1 = 0:0.001:100
x1 = sin(2*pi*t1);
Modsig = ammod(x1,fc,x);
plot(t,Modsig)
Z = fft(Modsig)
Q = abs(Z)
stem(f,Q)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote