Вы находитесь на странице: 1из 13

Fast Fourier Transform

Copyright 2003 Texas Instrume

Discrete Fourier Transform

Allows us to compute an approximation of the Fourier Transform on a discrete set of frequencies from a discrete set of time samples.

X( f ) =
N 1 n=0

x(t )e
k n N

j 2ft

dt

X [ k ] = x [ n] e

j 2

for k = 0, 1, , N 1

Where k are the index of the discrete frequencies and n the index of the time samples

SIEE, Slide 2

Copyright 2003 Texas Instrume

Inverse Discrete Fourier Transform

The inverse formula is:


1 x[ n] = N

X [k] e
k =0

N 1

j 2

k n N

for n = 0, 1, , N 1

Where, again, k are the index of the discrete frequencies and n the index of the time samples.

We have the following properties:


Discrete time Periodic time

periodic spectra discrete spectra

SIEE, Slide 3

Copyright 2003 Texas Instrume

DFT Computation

N 1 n=0

We can write the DFT:


j 2 N

X [ k ] = x[ n] WNkn for k = 0, 1, , N 1 with WN = e

We need:

N(N-1) complex + N2 complex


+ 16256 1047552 16773120 x 16384 1048576 16777216

N 128 1024 4096

SIEE, Slide 4

Copyright 2003 Texas Instrume

Fast Fourier Transform 1 of 3

Cooley-Tukey algorithm:

Based on decimation, leads to a factorization of computations. Let us first look at the classical radix 2 decimation in time. This particular case of the algorithm requires the time sequence length to be a power of 2. First we split the computation between odd and even samples:
N / 2 1 n=0 x[ 2n] WNk2n + N / 2 1 n=0 x[ 2n + 1] WNk ( 2n +1)

X [k] =

SIEE, Slide 5

Copyright 2003 Texas Instrume

Fast Fourier Transform 2 of 3

Using the following property:

W = WN
2 N 2

N / 2 1 n=0

The DFT can be rewritten:


-kn N 2

X [k] =

x [ 2n] W

+W

-k N

N / 2 1 n=0

x[ 2n + 1] W

-kn N 2

For k=0, 1, , N-1

SIEE, Slide 6

Copyright 2003 Texas Instrume

Fast Fourier Transform 3 of 3

Using the property that:

WN

k+

N 2

k = WN

The entire DFT can be computed with only k=0, 1, ,N/2-1.


x[ 2n] WNkn + WNk n=0 2 N / 2 1 n=0 x[ 2n + 1] WNkn 2

X [k] =

N / 2 1

and

N / 2 1 N N / 2 1 X k + = x[ 2n] WNkn WNk x[ 2n + 1] WNkn 2 n=0 n=0 2 2

SIEE, Slide 7

Copyright 2003 Texas Instrume

Butterfly

This leads to basic building block of the FFT, the butterfly.


X(0) X(1) We need: N/2(N/2-1) complex + for each N/2 DFT. (N/2)2 complex for each DFT. N/2 complex at the input of the butterflies. N complex + for the butter-flies. Grand total: N2/2 complex + N/2(N/2+1) complex WN/2-1

x(0) x(2) TFD N/2 x(N-2) x(1) x(3) TFD N/2 x(N-1) W0 W1 -

X(N/2-1) X(N/2) X(N/2+1)

X(N-1)

SIEE, Slide 8

Copyright 2003 Texas Instrume

If N/2 is even, we can further split the computation of each DFT of size N/2 into two computations of half size DFT. When N=2r this can be done until DFT of size 2 (i.e. butterfly with two elements).
x(0) x(4) x(2) x(6) x(1) W80 W80 3rd stage 2nd stage 1st stage X(0) X(1) W80 W81 W80 W80 W80 W80 W81 W81 W82 W83 X(2) X(3) X(4) X(5) X(6) X(7)

Recursion

W80=1

x(5) x(3) x(7)

SIEE, Slide 9

Copyright 2003 Texas Instrume

Number of Operations

If N=2r, we have r=log2(N) stages. For each one we have:


N/2 complex (some of them are by 1). N complex +. N/2 log2(N) complex . N log2(N) complex +.
N 128 1024 4096 + 896 10240 49152 x 448 5120 24576

Thus the grand total of operations is:


These counts can be compared with the ones for the DFT

SIEE, Slide 10

Copyright 2003 Texas Instrume

Shuffling the Data, Bit Reverse Ordering

At each step of the algorithm, data are split between even and odd values. This results in scrambling the order.
000 001 010 011 100 101 110 111
x(0) x(4) x(2) x(6) x(1) x(5) x(3) x(7) x(0) x(2) x(4) x(6) x(1) x(3) x(5) x(7) x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7)

index 000 100 010 110 001 101 011 111

addres s

Recursion of the algorithm

SIEE, Slide 11

Copyright 2003 Texas Instrume

Reverse Carry Propagation

This scrambling when we use radix 2 FFT can be obtained by the Reverse Carry Propagation (RCP) algorithm.
n 000 001 010 011 100 101 110 111 Address[x(n+1)] RCP(000+100)=100 RCP(100+100)=010 RCP(010+100)=110 RCP(110+100)=001 RCP(001+100)=101 RCP(101+100)=011 RCP(011+100)=111 Address[x(n)] 000 100 010 110 001 101 011 111

We start with address 0 then we add N/2 to obtain the next address. If there is a carry, it propagates towards the least significant bit. When the data arrive in natural order, they are scrambled in this way.

SIEE, Slide 12

Copyright 2003 Texas Instrume

Follow on Activities for TMS320C5416 DSK

Application 8 for the the TMS320C5416 DSK uses the FFT as a spectrum analyzer to display the power in an audio signal at various frequencies. Rather than using the optimized library DSPLIB for the FFT, it uses a C code version that is slower, but can be stepped through line by line using Code Composer Studio.

SIEE, Slide 13

Copyright 2003 Texas Instrume

Вам также может понравиться