Question

6. Let Xc(r) = cos 2π450t. This signal is sampled with f, = 1 .5kHz: x[n] = xe (nT), n = 0,±1, . . . where T, = 1/f, we have 512 samples of x[n]. (a) Plot X (el) of x[n], n = 0, ± 1 , ±2, . . . (b) Approximately plot the DFT magnitude |x(kl. The DFT size is N = 512.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB code is given below in bold letters.

clc;
close all;
clear all;

L = 512;

fs = 1.5e3;
Ts = 1/fs;
t = 0:1/fs:1/fs*(L-1);
x = cos(2*pi*450*t);


% DTFT of x[n]
w = -pi:0.01:pi;
n = 0:511;
for k = 1:length(w)
X_c(k) = sum(x.*exp(-1j*w(k)*n));
end

figure;
subplot(211);plot(w,abs(X_c));grid;title('Magnitude DTFT');
xlabel('w');ylabel('Amplitude');
subplot(212);plot(w,angle(X_c)*57.3);grid;title('Phase DTFT');
xlabel('w');ylabel('degrees');


% DFT of x[n]
X = fftshift(fft(x,512));
L = length(X);
figure;
subplot(211);plot(-L/2:L/2-1,abs(X));grid;title('Magnitude DFT');
xlabel('k');ylabel('Amplitude');
subplot(212);plot(-L/2:L/2-1,angle(X)*57.3);grid;title('Phase DFT');
xlabel('k');ylabel('degrees');

Magnitude DTFT 300 200 100 Phase DTFT 200 100 100 200 -3 2

Add a comment
Know the answer?
Add Answer to:
6. Let Xc(r) = cos 2π450t. This signal is sampled with f, = 1 .5kHz: x[n]...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT