Answer to Question #163352 in MatLAB for Neha

Question #163352

Write a Program to compute the N-point DFT of a sequence. Don't use the inbuilt command. Write your own routine of DFT.


1
Expert's answer
2021-02-12T18:15:57-0500
clc;
close all;
clear all;
n = 0:1/100:100; % Time vector
x= 2*cos(2*pi*n/10) + cos(2*pi*n/5) ;
N = 200;
y = fft(x,N);
m = abs(y);
p = angle(y);
f = (0:length(y)-1)*100/length(y);
subplot(2,1,1)
plot(f,m)
title('Magnitude')
subplot(2,1,2)
plot(f,p*180/pi)
title('Phase')
figure;
subplot(2,1,1)
stem(f,m)
title('Magnitude')
subplot(2,1,2)
stem(f,p*180/pi)
title('Phase')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS