Title: Fast Fourier Transform
1Fast Fourier Transform
2Fast Fourier Transform
- Efficient algorithm for calculating the Discrete
Fourier Transform - Presented by J.W Cooley and J.W. Tukey in paper
An algorithm for the machine calculation of
complex Fourier Series, Mathematics Compuation,
Vol 19, 1965, pg. 297-301
3FFT
In the Real DFT, the length of the output
frequency vectors is N/21, but in the Complex
DFT, it is N
4Periodic Nature of DFT
- Q. Why does the Complex DFT frequency array have
length N as opposed the Real DFT with length
N/21? - The Complex DFT doubles number of frequency
values by including negative frequencies which
mirror the positive frequencies - (0 frequency accounts for the 1)
5Negative Frequency Generation
- Can use a program to generate the negative
frequencies to fill out the rest of the complex
array (positions N/2 1 N)
6How the FFT works
- The FFT executes the following steps
-
- (1) Decomposing an N point time domain signal
into N time domain signals each composed of a
single point - (2) Calculate the N frequency spectra
corresponding to the N time domain signals - (3) The N spectra are synthesized into a
single frequency spectrum
7(1) Time domain decomposition
Log2N stages are required in the
decomposition Ie. A 16 point signal (24)
requires 4 stages A 512 point signal (27)
requires 7 stages A 4096 point signal (212)
requires 12 stages
8(1) Time domain decomposition
- The decomposition is simply a reordering of the
samples in the signal -
Notice that the reordering of the samples is done
in the order of bit-reversal of the binary
equivalent of the sample number The FFT time
domain decomposition can be carried out using a
bit reversal sorting algorithm
9(2) Calculate the N frequency Spectra
- The frequency of a 1 point signal is itself
- That is, the value of the signal is unchanged
- No computation is required in this step!
- Each of the 1 point signals that were time domain
signals are now 1 point frequency domain signals
10(3) Synthesize the frequency spectrum signal
- Last step in the FFT is to combine the N
frequency spectra in the exact reverse order that
the time domain decomposition took place - The bit reversal trick is not applicable in this
case, and we must go back one stage at a time - Continuing from our example
- First stage 16 frequency spectra (1 point each)
are synthesized into 8 frequency spectra (2
points each) - Second stage 8 frequency spectra (2 points each)
are synthesized into 4 frequency spectra (4
points each) - Third stage 4 frequency spectra (4 points each)
are synthesized into 2 frequency spectra (8
points each) - Fourth stage 2 frequency spectra (8 points each)
are synthesized into 1 frequency spectra (16
points)
113) Synthesize the frequency spectrum signal
- The frequency spectra are combined in the FFT by
duplicating them, and - then adding the duplicated spectra together
- The odd frequency spectrum must also be
multiplied by a sinusoid - (the shift in time domain corresponds to this
multiplication)
12FFT Butterfly
- The butterfly is the basic computational element
of the FFT, transforming two complex points into
two other complex points
13Flow diagram of FFT
- Frequency Domain synthesis requires 3 loops
- Outer loop runs through the Log2N stages
- Middle loop moves through each of the individual
spectra in the stage being worked on - Innermost loop uses the butterfly to calculate
the points in each frequency spectra - The overhead in the boxes
- determine the beginning and
- ending indexes for the loops, as
- well as calculating the sinusoids
- needed in the butterflies
14FFT Program in BASIC
15FFT Programs
- In-place computation same arrays are used for
the input, intermediate storage and output ?
efficient use of memory - In the BASIC program, data enter and leave the
subroutine in the arrays REX and IMX , with
the samples running from index 0 to N-1. - Upon return from the subroutine, REX and IMX
are overwritten with the frequency domain data. - The length of the DFT must also be passed to the
subroutines. - BASIC program uses variable N
16Inverse FFT
- Complex DFT has strong duality
- This means there is symmetry between the time and
frequency domains - The Inverse DFT is nearly identical to the
Forward DFT - Easiest way to calculate an Inverse FFT is to
calculate a Forward FFT, and then adjust the data
17Testing the FFT
- Two tests
- Start with some arbitrary time domain signal
input, and run it through the FFT. - Now run the resultant frequency spectrum
through the Inverse FFT. - - The result should be identical with the input
- Symmetry test.
- Frequency domain of the complex DFT should be
symmetrical around samples 0 and N/2. - -Results in the Inverse DFT producing a time
domain that has - an imaginary part compromising of
all zeros
18FFT Performance
- Time required for bit reversal negligible
- Each of the Log2N stages has N butterfly
computations
Where kFFT is a constant related to the processor
speed ie. kFFT 10 µs on a 100 MHz Pentium