Sie sind auf Seite 1von 2

DISCRETE FOURIER TRANSFORM:

clc;
x=input('enter the input sequence');
y=fft(x);
%for displaying input x(n)
t=0:1:length(x)-1;
subplot(1,3,1);
stem(t,x);
xlabel('value of n');
ylabel('amplitude');
title('input sequence x(n)');
%for displaying magnitude plot
subplot(1,3,2);
stem(t,abs(y));
xlabel('value of n');
ylabel('amplitude');
title('magnitude plot');
% for displaying phase plot
subplot(1,3,3);
stem(t,angle(y));
xlabel('value of n');
ylabel('amplitude');
title('phase plot');

disp(y);
disp(abs(y));
disp(angle(y));
OUTPUT:
enter the input sequence[1 1 0 0]
2.0000

1.0000 - 1.0000i

2.0000 1.4142

0 -0.7854

0 1.4142

0 0.7854

1.0000 + 1.0000i

Das könnte Ihnen auch gefallen