0% found this document useful (0 votes)
104 views1 page

FFT Dif R2

This document describes an algorithm for performing a radix-2 decimation-in-frequency (DIF) fast Fourier transform (FFT). It takes an input array, pads it with zeros if needed to reach the next power of 2 in size, then performs the FFT by doing a series of butterfly operations across multiple stages, with each stage using a different complex multiplier. It finally performs bit reversal to return the output in normal order.

Uploaded by

Delia Ines
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views1 page

FFT Dif R2

This document describes an algorithm for performing a radix-2 decimation-in-frequency (DIF) fast Fourier transform (FFT). It takes an input array, pads it with zeros if needed to reach the next power of 2 in size, then performs the FFT by doing a series of butterfly operations across multiple stages, with each stage using a different complex multiplier. It finally performs bit reversal to return the output in normal order.

Uploaded by

Delia Ines
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

% Radix

2 Decimation in Frequency
% Input
: Normal Order
%
Output: Normal Order (Output Bits reversed)
% For
the any length of N (RADIX 2 DIF)
% Done
by Nevin Alex Jacob
%
Modified by Nazar Hnydyn
%
example : FFT_DIF_R2([1 2 3 4 5 ])

function [ y ] = FFT_DIF_R2( x ) % entry


point to the function of FFT decimation in frequency
p=nextpow2(length(x)); %
checking the size of the input array
x=[x zeros(1,(2^p)-length(x))]; %
complementing an array of zeros if necessary
N=length(x); %
computing the array size
S=log2(N); %
computing the number of conversion stages
Half=N/2; % half
the length of the array
for stage=1:S; %
stages of transformation
for index=0:(N/(2^(stage-1))):(N-1); %
series of "butterflies" for each stage
for n=0:(Half-1); %
creating "butterfly" and saving the results
pos=n+index+1; % index
of the data sample
pow=(2^(stage-1))*n; % part
of power of the complex multiplier
w=exp((-1i)*(2*pi)*pow/N); %
complex multiplier
a=x(pos)+x(pos+Half); % 1-st
part of the "butterfly" creating operation
b=(x(pos)-x(pos+Half)).*w; % 2-nd
part of the "butterfly" creating operation
x(pos)=a; %
saving computation of the 1-st part
x(pos+Half)=b; %
saving computation of the 2-nd part
end;
end;
Half=Half/2; %
computing the next "Half" value
end;
y=bitrevorder(x); %
performing bit-reverse operation and returning the result from function
end

You might also like