FAST FOURIER TRANSFORM

clc;
clear all;
close all;
x=input('Enter the Sequence:');
n=input('Enter the Length:');
y=fft(x,n);
subplot(221);
stem(x);x
xlabel('Time');
ylabel('Amplitude');
title('Input Sequence');
subplot(222);
stem(y);y
xlabel('Real Axis');
ylabel('Imaginary Axis');
title('FFT Sequence');
subplot(223);
stem(abs(y));abs(y)
xlabel('Frequency');
ylabel('Magnitude');
title('Magnitude Response');
subplot(224);
stem(angle(y));angle(y)
xlabel('Frequency');
ylabel('Phase');
title('Phase Response');

Input:

Enter the Sequence:[1 0 1 0 1 0 1 0]
Enter the Length:8

Output:


x =

1 0 1 0 1 0 1 0


y =

4 0 0 0 4 0 0 0


ans =

4 0 0 0 4 0 0 0


ans =

0 0 0 0 0 0 0 0

No comments:

Post a Comment