Sie sind auf Seite 1von 1

clc

clear all
x=input('Enter the input sequence x(n): ');
N=input('Enter the number of points needed: ');
if(N<length(x))
error('N should be >= to length of x');
end;
X=fft(x,N);
disp('The DFT of the given sequnce is: ');X
n=0:1:N-1;
subplot(1,2,1);
stem(n,abs(X));
xlabel('TIME INDEX n------------------>');
ylabel('MAGNITUDE-------------------->');
title('MAGNITUDE RESPONSE');
grid on
subplot(1,2,2);
stem(n,(angle(X)*180/pi));
xlabel('TIME INDEX n------------------>');
ylabel('PHASE -------------------->');
title('PHASE RESPONSE');
grid on
<<rameshpkd@gmail.com>>>

Das könnte Ihnen auch gefallen