You are on page 1of 3

ECE-2006

DIGITAL SIGNAL PROCESSING


L33+L34

LAB TASK-6
Name: Anvita Tadepalli
Reg.no: 20BEC0377

• N Point DIT FFT

Title
Performing N Point DIT FFT

Aim
To write a Matlab program to perform the N Point DIT FFT of a given
sequence of numbers.

Code
%20BEC0377
%Anvita Tadepalli
%9701912932
%L-33+34
%Lab Task_06
%Title: Write a matlab program to perform an N point DIT FFT for a given
%sequence.

clc;clear all;
close all;
a1=[-1 2 -3 4 9 -20 12 6];
pad=nextpow2(length(a1));
a=[a1 zeros(1,2^pad-length(a1))];
a=bitrevorder(a);
len=length(a);
for s=1:log2(len)
m=2^s
m=bitshift(2,s-1,'int64');
omega_m = exp((-2*pi*1i)/m);
for k=0:m:len-1
omega=1;
for j=0:m/2-1
t=omega*(a(j+k+1+m/2));
u=a(j+k+1);
a(j+k+1)=u+t;
a(j+k+1+m/2)=u-t;
omega=omega*omega_m;
end
end
end
f=a;
Output

Conclusion
Hence, for the given sequence [-1 2 -3 4 9 -20 12 6] the DIT FFT has
been performed and the output values were obtained as shown in
the output window [9 6.9 -1 -26 25 -26 -1 6.9]

You might also like