Connexions

You are here: Home » Content » The FFT Algorithm
Content Actions
Lenses

What is a lens?

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

This content is ...
Affiliated with (?)
This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • This module is included inLens: Rice University OpenCourseWare
    By: OpenCourseWare ConsortiumAs a part of collection:"Intro to Digital Signal Processing"

    Click the "Rice University OCW" link to see all content affiliated with them.

    Rice University OCW
Tags

(?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

The FFT Algorithm

Module by: Robert Nowak

Summary: The FFT, an efficient way to compute the DFT, is introduced and derived throughout this module.

Definition 1: FFT
(Fast Fourier Transform) An efficient computational algorithm for computing the DFT.

The Fast Fourier Transform FFT

DFT can be expensive to compute directly k,0kN-1:Xk=n=0N-1xn-2πkNn k 0 k N 1 X k n 0 N 1 x n 2 k N n
For each kk, we must execute:
  • NN complex multiplies
  • N-1 N 1 complex adds
The total cost of direct computation of an NN-point DFT is
  • N2 N 2 complex multiplies
  • NN-1 N N 1 complex adds
How many adds and mults of real numbers are required?
This " ON2 O N 2 " computation rapidly gets out of hand, as NN gets large:
NN 1 10 100 1000 106 106
N2 N2 1 100 10,000 106 106 1012 1012
figure1.png
Figure 1
The FFT provides us with a much more efficient way of computing the DFT. The FFT requires only " ONlogN O N N " computations to compute the NN-point DFT.
NN 10 100 1000 106 106
N2 N2 100 10,000 106 106 1012 1012
Nlog10N N 10 N 10 200 3000 6×106 66
How long is 1012μsec 10 12 μsec ? More than 10 days! How long is 6×106μsec 66 μsec ?
figure2.png
Figure 2
The FFT and digital computers revolutionized DSP (1960 - 1980).

How does the FFT work?

  • The FFT exploits the symmetries of the complex exponentials WNkn=-2πNkn WN k n 2 N k n
  • WNkn WN k n are called "twiddle factors"
Symmetry 1: Complex Conjugate Symmetry 
WNkN-n=WN-kn=WNkn¯ WN k N n WN k n WN k n -2πkNN-n=2πkNn=-2πkNn¯ 2 k N N n 2 k N n 2 k N n
Symmetry 2: Periodicity in n and k 
WNkn=WNkN+n=WNk+Nn WN k n WN k N n WN k N n -2πNkn=-2πNkN+n=-2πNk+Nn 2 N k n 2 N k N n 2 N k N n WN=-2πN WN 2 N

Decimation in Time FFT

  • Just one of many different FFT algorithms
  • The idea is to build a DFT out of smaller and smaller DFTs by decomposing xn x n into smaller and smaller subsequences.
  • Assume N=2m N 2 m (a power of 2)

Derivation

NN is even, so we can complete Xk X k by separating xn x n into two subsequences each of length N2 N 2 . xnN2ifn=evenN2ifn=odd x n N 2 n even N 2 n odd k,0kN-1:Xk=n=0N-1xnWNkn k 0 k N 1 X k n 0 N 1 x n WN k n Xk=xnWNkn+xnWNkn X k n 2 r x n WN k n n 2 r 1 x n WN k n where 0rN2-1 0 r N 2 1 . So
Xk=r=0N2-1x2rWN2kr+r=0N2-1x2r+1WN2r+1k=r=0N2-1x2rWN2kr+WNkr=0N2-1x2r+1WN2kr X k r 0 N 2 1 x 2 r WN 2 k r r 0 N 2 1 x 2 r 1 WN 2 r 1 k r 0 N 2 1 x 2 r WN 2 k r WN k r 0 N 2 1 x 2 r 1 WN 2 k r (1)
where WN2=-2πN2=-2πN2= W N 2 WN 2 2 N 2 2 N 2 W N 2 . So Xk=r=0N2-1x2r W N 2 kr+WNkr=0N2-1x2r+1 W N 2 kr X k r 0 N 2 1 x 2 r W N 2 k r WN k r 0 N 2 1 x 2 r 1 W N 2 k r where r=0N2-1x2r W N 2 kr r 0 N 2 1 x 2 r W N 2 k r is N2 N 2 -point DFT of even samples ( Gk G k ) and r=0N2-1x2r+1 W N 2 kr r 0 N 2 1 x 2 r 1 W N 2 k r is N2 N 2 -point DFT of odd samples ( Hk H k ). k,0kN-1:Xk=Gk+WNkHk k 0 k N 1 X k G k WN k H k Decomposition of an NN-point DFT as a sum of 2 N2 N 2 -point DFTs.
Why would we want to do this? Because it is more efficient!
Recall: Cost to compute an NN-point DFT is approximately N2 N 2 complex mults and adds.
But decomposition into 2 N2 N 2 -point DFTs + combination requires only N22+N22+N=N22+N N 2 2 N 2 2 N N 2 2 N where the first part is the number of complex mults and adds for N2 N 2 -point DFT, Gk G k . The second part is the number of complex mults and adds for N2 N 2 -point DFT, Hk H k . The third part is the number of complex mults and adds for combination. And the total is N22+N N 2 2 N complex mults and adds.
Example 1: Savings 
For N=1000 N 1000 , N2=106 N 2 10 6 N22+N=1062+1000 N 2 2 N 10 6 2 1000 Because 1000 is small compared to 500,000, N22+N1062 N 2 2 N 10 6 2
So why stop here?! Keep decomposing. Break each of the N2 N 2 -point DFTs into two N4 N 4 -point DFTs, etc., ....
We can keep decomposing: N21=N2N4N8N2m-1N2m=1 N 2 1 N 2 N 4 N 8 N 2 m 1 N 2 m 1 where m=log2N= times m 2 N  times
Computational cost: N N-pt DFT  two N2 N 2 -pt DFTs. The cost is N22N22+N N 2 2 N 2 2 N . So replacing each N2 N 2 -pt DFT with two N4 N 4 -pt DFTs will reduce cost to 22N42+N2+N=4N42+2N=N222+2N=N22p+pN 2 2 N 4 2 N 2 N 4 N 4 2 2 N N 2 2 2 2 N N 2 2 p p N As we keep going p=34m p 3 4 m , where m=log2N m 2 N . We get the cost N22log2N+Nlog2N=N2N+Nlog2N=N+Nlog2N N 2 2 2 N N 2 N N 2 N N 2 N N N 2 N N+Nlog2N N N 2 N is the total number of complex adds and mults.
For large NN, costNlog2N cost N 2 N or " ONlog2N O N 2 N ", since Nlog2NN N 2 N N for large NN.
figure3.png
Figure 3: N=8 N 8 point FFT. Summing nodes Wnk Wn k twiddle multiplication factors.
Note: Weird order of time samples
figure4.png
Figure 4: This is called "butterflies."

Comments, questions, feedback, criticisms?

Send feedback