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

FFT

ManywaystodecomposeanFFT Simplestisradix2 Computationmadeupofradix2butterflies

A B

X = A + BW Y = A BW

B.Baas, 2012,EEC281

14

FFT Dataflow Diagram


Dataflowdiagram
N=64 radix2 6stages of computation
0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 63

Memory Locations

Input
B.Baas, 2012,EEC281

Output
15

Radix 2, 8-point FFT

B.Baas, 2012,EEC281

16

Radix 2, 8-point FFT

Radix 2, 16-point FFT

B.Baas, 2012,EEC281

17

Radix 2, 8-point FFT

Radix 2, 32-point FFT

B.Baas, 2012,EEC281

18

Radix 2, 8-point FFT

Radix 2, 64-point FFT

B.Baas, 2012,EEC281

19

Radix 2, 256-point FFT

Radix 2, 256-point FFT

B.Baas, 2012,EEC281

20

Radix 4, 16-point FFT

B.Baas, 2012,EEC281

21

Radix 4, 64-point FFT

B.Baas, 2012,EEC281

22

Radix 4, 256-point FFT

B.Baas, 2012,EEC281

23

Radix 2, Decimation-In-Time (DIT)


Inputorderdecimatedneedsbitreversal Outputinorder Criticalpath: Butterfly:
B A B X = A + BW x Y = A BW A car-sav add +
B.Baas, 2012,EEC281
24

Radix 2, Decimation In Frequency (DIF)


Inputinorder Outputdecimatedneeds bitreversal Butterfly:
TwoCPAs Widermultiplier A B X=A+B Y = (A B) W Criticalpath: A B

+ ()
W

x +
25

B.Baas, 2012,EEC281

Radix 4, DIT Butterfly


DecimationinTime(DIT)orDecimationin Frequency(DIF)

A B C D

V W X Y

B.Baas, 2012,EEC281

26

Bit-Reversed Addressing
Normally:
DIT:bitreverseinputsbeforeprocessing
BIT REVERSAL

DIF:bitreverseoutputsafterprocessing

Reverseaddressingbitsforread/writeofdata
000(0) 001(1) 010(2) 011(3) 100(4) 101(5) 110(6) 111(7) 000(0)#Word0doesnotmovelocation 100(4)#Originalword1goestolocation4 010(2)#Word2doesnotmovelocation 110(6)#Originalword3goestolocation6 001(1) #Originalword4goestolocation1 101(5) #Word5doesnotmovelocation 011(3) #Originalword6goestolocation3 111(7) #Word7doesnotmovelocation

BIT REVERSAL

Addressing In Matlab (Especially helpful for FFTs)


Matlab
Matlabcannotindexarrayswithindexzero!

Inmatlab,doaddresscalculationsnormally
AddrA AddrB =0,2,4, =1,3,5,

thenusepointerswithanoffsetofonewhenever indexingarrays
AddrA =; AddrB =; A =data(AddrA+1); B =data(AddrB+1); data(AddrA+1)=X; data(AddrB+1)=Y;
B.Baas, 2012,EEC281
28

Higher Radices
Radix2andradix4arecertainlythemostpopular Radix4isontheorderof20%moreefficientthan radix2forlargetransforms Radix8issometimesused,butlongerradix butterfliesarenotcommonbecauseadditional efficienciesaresmallandaddedcomplexityisnon trivial(especiallyforhardwareimplementations)

B.Baas, 2012,EEC281

29

I. Common-Factor FFTs
Keycharacteristics
MostcommonclassofFFTs AlsocalledCooleyTukey FFTs FactorsofN usedindecompositionhavecommonfactor(s)

A)Radixr
N =rk, wherek isapositiveinteger Butterfliesusedineachstagearethesame Radixr butterfliesareused N/r butterfliesperstage k =logr N stages

B.Baas, 2012,EEC281

30

I. Common-Factor FFTs
B)Mixedradix
Radicesofcomponentbutterfliesarenotallequal Morecomplexthanradixr IsnecessaryifN rk Example
N=32 Couldcalculatewithtworadix4stagesandoneradix2stage

B.Baas, 2012,EEC281

31

II. Prime-Factor FFTs


Thelengthoftransformsmustbetheproductof relativelyprimenumbers Thiscanbelimiting,thoughitisoftenpossibleto findlengthsnearpopularpowerof2lengths (e.g.,7x11x13=1003) TheirgreatadvantageisthattheyhavenoWN twiddlefactormultiplications Irregularsortingofinputandoutputdata Irregularaddressingforbutterflies

B.Baas, 2012,EEC281

32

III. Other FFTs


SplitradixFFT
When N =pk,wherep isasmallprimenumberandk isa positiveinteger,thismethodcanbemoreefficientthan standardradixp FFTs SplitradixAlgorithmsforLengthpm DFTs, Vetterli and Duhamel,Trans.onAcoustics,Speech,andSignalProcessing, Jan.1989 A B C D
B.Baas, 2012,EEC281

V W Wa X Y
33

Wb

III. Other FFTs


Winograd FourierTransformAlgorithm(WFTA)
TypeofprimefactoralgorithmbasedonDFTbuilding blocksusingahighlyefficientconvolutionalgorithm RequiresmanyadditionsbutonlyorderN multiplications Hasoneofthemostcomplexandirregularstructures

FFTW(www.fftw.org)
Csubroutinelibrarieshighlytunedforspecificarchitectures

Goertzel DFT
Notanormal FFTinthatitscomputationalcomplexityis stillorderN2 ItallowsasubsetoftheDFTs N outputtermstobe efficientlycalculated

B.Baas, 2012,EEC281

34

Signal Growth
NoteinDFTequationsignalcangrowbyN times ThisisalsoseenintheFFTinitsgrowthbyr timesin aradixr butterfly,andlogrN stagesintheentire transform:r ^(logrN) =N Thus,theFFTprocessorrequirescarefulscaling
Floatingpointnumberrepresentation
Easiestconceptually,butexpensivehardware.Typicallynot usedinefficientDSPsystems.

Fixedpointwithscalingby1/r everystage
Firststageisaspecialcase.Scalingmustbedoneontheinputs beforeprocessingtoavoidoverflowwithlargemagnitude complexinputswithcertainphases.

Blockfloatingpoint
B.Baas, 2012,EEC281
35

Efficient Computation of the IFFT


DesignaseparateprocessorforIFFTs ReuseaforwardFFTengineifavailabletocalculate
out = IFFT(in)

Swappingrealandimaginaryparts:
a = fft(imag(in) + i*real(in)); out = (imag(a) + i*real(a));

Usingconjugates:
a = fft(conj(in)); out = conj(a);

Asimpleindexingchange:
a = fft(in); out = [a(0) a(N-1:-1:1)]; out = [a(1) a(N :-1:2)]; % with normal indices % with weird matlab indices

B.Baas, 2012,EEC281

36