Chapter 19 Fast Fourier Transform

Slides:



Advertisements
Similar presentations
Chapter 19 Fast Fourier Transform
Advertisements

DFT & FFT Computation.
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
DFT and FFT FFT is an algorithm to convert a time domain signal to DFT efficiently. FFT is not unique. Many algorithms are available. Each algorithm has.
The Discrete Fourier Transform. The spectrum of a sampled function is given by where –  or 0 .
DFT/FFT and Wavelets ● Additive Synthesis demonstration (wave addition) ● Standard Definitions ● Computing the DFT and FFT ● Sine and cosine wave multiplication.
Chapter 8: The Discrete Fourier Transform
FFT-based filtering and the Short-Time Fourier Transform (STFT) R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2003.
Introduction to Fast Fourier Transform (FFT) Algorithms R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2003.
Introduction SYSC5603 (ELG6163) Digital Signal Processing Microprocessors, Software and Applications Miodrag Bolic.
Chapter 12 Fourier Transforms of Discrete Signals.
Lecture #18 FAST FOURIER TRANSFORM INVERSES AND ALTERNATE IMPLEMENTATIONS Department of Electrical and Computer Engineering Carnegie Mellon University.
Chapter 19 Fast Fourier Transform (FFT) (Theory and Implementation)
1 Real time signal processing SYSC5603 (ELG6163) Digital Signal Processing Microprocessors, Software and Applications Miodrag Bolic.
Unit 7 Fourier, DFT, and FFT 1. Time and Frequency Representation The most common representation of signals and waveforms is in the time domain Most signal.
Discrete Time Periodic Signals A discrete time signal x[n] is periodic with period N if and only if for all n. Definition: Meaning: a periodic signal keeps.
Fast Fourier Transforms
DTFT And Fourier Transform
Processor Architecture Needed to handle FFT algoarithm M. Smith.
Jeff Wang Kay-Won Chang March 18, DEMO Harmonic Product Spectrum (HPS) pitch detection: obtain fundamental frequency from FFT Fast Fourier Transform.
Hossein Sameti Department of Computer Engineering Sharif University of Technology.
Digital Signal Processing Chapter 3 Discrete transforms.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Under-Graduate Project Case Study: Single-path Delay Feedback FFT Speaker: Yu-Min.
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Lecture#10 Spectrum Estimation
Speaker: Darcy Tsai Advisor: Prof. An-Yeu Wu Date: 2013/10/31
DEPARTMENTT OF ECE TECHNICAL QUIZ-1 AY Sub Code/Name: EC6502/Principles of digital Signal Processing Topic: Unit 1 & Unit 3 Sem/year: V/III.
Professor A G Constantinides 1 Discrete Fourier Transforms Consider finite duration signal Its z-tranform is Evaluate at points on z-plane as We can evaluate.
Fast Fourier Transform (FFT) Problem: we need an efficient way to compute the DFT. The answer is the FFT. Consider a data sequence and its DFT: We can.
Fast Fourier Transforms. 2 Discrete Fourier Transform The DFT pair was given as Baseline for computational complexity: –Each DFT coefficient requires.
The Discrete Fourier Transform
EE345S Real-Time Digital Signal Processing Lab Fall 2006 Lecture 17 Fast Fourier Transform Prof. Brian L. Evans Dept. of Electrical and Computer Engineering.
Real-time Digital Signal Processing Digital Filters.
بسم الله الرحمن الرحيم Digital Signal Processing Lecture 14 FFT-Radix-2 Decimation in Frequency And Radix -4 Algorithm University of Khartoum Department.
Discrete Fourier Transform
1 Chapter 8 The Discrete Fourier Transform (cont.)
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
Chapter 4 Discrete-Time Signals and transform
CS 591 S1 – Computational Audio
CS 591 S1 – Computational Audio
DIGITAL SIGNAL PROCESSING ELECTRONICS
3.1 Introduction Why do we need also a frequency domain analysis (also we need time domain convolution):- 1) Sinusoidal and exponential signals occur.
FFT-based filtering and the
Sampling rate conversion by a rational factor
Fast Fourier Transforms Dr. Vinu Thomas
Fast Fourier Transform
Fast Fourier Transform (FFT) (Section 4.11)
Sampling and the Discrete Fourier Transform
Real-time double buffer For hard real-time
DFT and FFT By using the complex roots of unity, we can evaluate and interpolate a polynomial in O(n lg n) An example, here are the solutions to 8 =
Lecture #17 INTRODUCTION TO THE FAST FOURIER TRANSFORM ALGORITHM
Real-time 1-input 1-output DSP systems
4.1 DFT In practice the Fourier components of data are obtained by digital computation rather than by analog processing. The analog values have to be.
Fast Fourier Transformation (FFT)
Chapter 9 Computation of the Discrete Fourier Transform
LECTURE 18: FAST FOURIER TRANSFORM
Speaker: Yumin Adviser: Prof. An-Yeu Wu Date: 2013/10/24
Real time signal processing
Lecture #18 FAST FOURIER TRANSFORM ALTERNATE IMPLEMENTATIONS
Introduction SYSC5603 (ELG6163) Digital Signal Processing Microprocessors, Software and Applications Miodrag Bolic.
Introduction SYSC5603 (ELG6163) Digital Signal Processing Microprocessors, Software and Applications Miodrag Bolic.
Fast Fourier Transform (FFT) Algorithms
Speaker: Chris Chen Advisor: Prof. An-Yeu Wu Date: 2014/10/28
Lecture #17 INTRODUCTION TO THE FAST FOURIER TRANSFORM ALGORITHM
Fast Fourier Transform
LECTURE 18: FAST FOURIER TRANSFORM
Fourier Transforms of Discrete Signals By Dr. Varsha Shah
Electrical Communications Systems ECE
Electrical Communications Systems ECE
Presentation transcript:

Chapter 19 Fast Fourier Transform DSP C5000 Chapter 19 Fast Fourier Transform

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. Where k are the index of the discrete frequencies and n the index of the time samples

Inverse Discrete Fourier Transform The inverse formula is: 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 spectra Periodic time discrete spectra

DFT Computation We can write the DFT: We need: N(N-1) complex ‘+’ Each complex addition requires two real additions. Each complex multiplication requires 4 real multiplications and 3 real additions.

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:

Fast Fourier Transform 2 of 3 Using the following property: The DFT can be rewritten: For k=0, 1, …, N-1

Fast Fourier Transform 3 of 3 Using the property that: The entire DFT can be computed with only k=0, 1, …,N/2-1. and

Butterfly This leads to basic building block of the FFT, the butterfly. x(0) TFD N/2 X(0) 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 ‘×’ x(2) X(1) x(N-2) X(N/2-1) x(1) W0 TFD N/2 X(N/2) - x(3) W1 X(N/2+1) - x(N-1) WN/2-1 X(N-1) -

Recursion 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). 3rd stage 2nd stage 1st stage x(0) X(0) W80 x(4) X(1) - W80 x(2) X(2) - W80 W81 x(6) X(3) - - W80 x(1) X(4) - W80=1 W80 W81 x(5) X(5) - - W80 W82 x(3) X(6) - - W80 W81 W83 x(7) X(7) - - -

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 ‘+’. Thus the grand total of operations is: N/2 log2(N) complex ‘×’. N log2(N) complex ‘+’. These counts can be compared with the ones for the DFT

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. Recursion of the algorithm

Reverse Carry Propagation This scrambling when we use radix 2 FFT can be obtained by the Reverse Carry Propagation (RCP) algorithm. 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.

Algorithm Parameters 1 of 2 The FFT can be computed according to the following pseudo-code: For each stage For each group of butterfly For each butterfly compute butterfly end

Algorithm Parameters 2/2 The parameters are shown below:

Scaling The DFT computation for each k is : To prevent overflow we need to have: This is guaranteed provided a scale factor 1/N

Quantization Noise Quantization step is : If words have b+1 bits and x(n) belongs to [-1,1] If we assume that each real multiplication gives rise to a noise source of power The total amount of noise power for each X(k) is given by

Signal to Quantization Noise Ratio (SQNR) DFT case If we assume x(n) uniform in [-1,1], after scaling, variance of data become: And because each X(k) comes from N summations: SQNR for DFT with scaling is given by: 16 bits per word ENOB: effective number of bits, gives the effective resolution given a SNR. Based on the assumption that 6dB of SNR equates to 1 bit of precision.

Signal to Quantization Noise Ratio (SQNR) FFT case 1 of 3 The computation of one X(k) requires N-1 butterflies: N/2 butterflies of the 1st stage N/4 butterflies of the 2nd stage 1 butterfly of the last stage x(0) X(0) W80 x(4) X(1) - W80 x(2) X(2) - W80 W81 x(6) X(3) - - W80 x(1) X(4) - W80 W81 x(5) X(5) - - W80 W82 x(3) X(6) - - W80 W81 W83 x(7) X(7)

Signal to Quantization Noise Ratio (SQNR) FFT case 2 of 3 Butterfly computation To prevent overflow, we only need to scale the inputs of each butterfly by 1/2 Xn(l) Xn+1(l) W Xn(k) Xn+1(k) - 1/2 Because we have r stages, the global scaling factor for one output is: Xn(l) Xn+1(l) 1/2 W Xn(k) Xn+1(k) -

Signal to Quantization Noise Ratio (SQNR) FFT case 3 of 3 Quantization noise source at one stage is attenuated by scale factors of all the following stages. This gives an equivalent noise source of: for each output. SQNR for FFT with scaling is given by: 16 bits per word

FFT Algorithm with Block Floating Point Scaling Input data in bit reverse order Set-up for next stage More groups ? Set-up for next group More stages ? Set-up for next butterfly Scale inputs of butterfly (×1/2) End of algorithm Compute butterfly More butterflies ?

Case Study ‘C54x Use of audioFFT* inBuffer PCM3002 ADC pipRx Block processing pipTx PCM3002 DAC outBuffer (*) this program is the same as \ti\examples\dsk5416\bios\audio except for some slight modifications that will be emphazised when necessary

Audio Program Block processing is echo() function in audio.c : In the original program: Data from input stream are copied directly in output stream. In the modified program : The input stream is split between left and right in two separate buffers. Each buffer is processed Bit-reverse scrambling Forward transform Bit reverse scrambling Inverse transform Resulting left and right buffers are interleaved in the output stream.

DSPLIB functions The DSP Library (DSPLIB) is a collection of high-level optimized DSP function modules for the ‘C54x and ‘C55x DSP platform. ‘C54x DSPLIB functions for FFT computation

Block Processing 1 of 3 Echo( ) Include and declarations

Block Processing 2 of 3 Dsplib functions calls

‘C54x DSPLIB Bit Reversal

Block Processing 3 of 3 Linker .cmd file

‘C54x DSPLIB FFT

To Run the Build Process Project options

To Change the Size of the Processing Buffer Change buffer length declaration in echo function (audio.c) Change the call to cfft and cifft according to the size of the FFT (must be hard coded) Change buffer alignment in linker .cmd file

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.