fft and dft algorithm

24
FFT & DFT A Divide and Conquer Algorithm

Upload: umer-javed

Post on 17-Feb-2017

189 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: FFT and DFT algorithm

FFT & DFT

A Divide and Conquer Algorithm

Page 2: FFT and DFT algorithm

2

Fourier theorem. [Fourier, Dirichlet, Riemann] Any (sufficiently smooth)periodic function can be expressed as the sum of a series of sinusoids.

Fourier analysis

𝑦 (𝑡 )= 2𝜋∑𝑘=1𝑁 𝑆𝑖𝑛𝑘𝑡

𝑘 𝑁=100

Sinusoids. Sum of sine and cosines = sum of complex exponentials.

May 1, 2023 By:Muhammad Umer Javed

Page 3: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 3

Signal. [touch tone button 1]

Time domain.

Frequency domain.

Time domain vs. frequency domain

Page 4: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 4

FFT. Fast way to convert between time-domain and frequency-domain. Alternate viewpoint. Fast way to multiply and evaluate polynomials.

There are two ways to represent polynomials• Coefficient representation• Point value representation

Fast Fourier transform

We take this approach

Page 5: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 5

Polynomial. [coefficient representation]

Add. O(n) arithmetic operations.

Evaluate. O(n) using Horner's method.

Multiply (convolve). using brute force.

Polynomials: coefficient representation

Page 6: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 6

Fundamental theorem of algebra. A degree n polynomial with complex coefficients has exactly n complex roots.

Corollary. A degree n – 1 polynomial A(x) is uniquely specified by itsevaluation at n distinct values of x

Polynomials: point-value representation

Page 7: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 7

Polynomial. [point-value representation]

Add. O(n) arithmetic operations.

Multiply (convolve). O(n), but need 2n – 1 points.

Evaluate. O(n2) using Lagrange's formula.

Polynomials: point value representation

Page 8: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 8

Point-value => coefficient . Given distinct points , Evaluate it at distinct points

Running time. O(n2) for matrix-vector multiply (or n Horner's)..

Converting between two representations: brute force

Page 9: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 9

Coefficient => point-value. Given distinct points and values , find unique polynomial , that has given values at given points.

Running time. for Gaussian elimination.

Converting between two representations: brute force

Vandermonde matrix is invertible iff xi distinct

Page 10: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 10

Tradeoff. Fast evaluation or fast multiplication. We want both!Converting between two representations

Goal. Efficient conversion between two representations ⇒ all ops fast.

Page 11: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 11

Example

Equation

Page 12: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 12

DISCRETE FOURIER TRANSFORM

Page 13: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 13

Coefficient => point-value. Given a polynomial evaluate it at n distinct points Key idea. Choose where is principal root of unity.

Discrete Fourier transform

𝜔32

𝜔21

𝜔10

1+𝜔1+𝜔2=0Cube root of unity 8th root of unity will be =

Page 14: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 14

Goal. Evaluate a degree polynomial at its roots of unity: Divide. Break up polynomial into even and odd powers.•

Conquer. Evaluate and at the roots of unity:

Fast Fourier transform

𝒗𝒌=(𝝎𝒌+𝟏𝟐 𝒏)𝟐 𝝎𝒌+(𝟏𝟐 )𝒏

=−𝝎𝒌

Page 15: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 15

For each k

• for DFT• for FFT …….

How! lets see

As where

Fast Fourier Transform

Page 16: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 16

Complex multiplies require 4 real multiplies and 2 real additions, whereas complex additions require just 2 real additions. So the complex multiplies are the primary concern.

increases rapidly with N,

By exploiting the following properties of W: • Symmetry property: • Periodicity property: • Recursion property:

FFT

So how can we reduce the amount of computation?

Page 17: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 17

As we take an example of DFT of N=4 so it becomes FFT: Symmetric Property

is symmetric in unit circle but in opposite direction so having a –ve sign

Page 18: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 18

When equation becomes FFT: Example

Page 19: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 19

FFTFor indices where

So we get

also

DFT of even samples DFT of odd

samples

But

Page 20: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 20

FFT: Algorithem

Page 21: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 21

FFT : Algorithem

Page 22: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 22

Theorem. The FFT algorithm evaluates a degree n – 1 polynomial at each of the nth roots of unity in O(n log n) steps and O(n) extra space

FFT : Time Complexty

Assume is in power of 2

Page 23: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 23

Theorem. The inverse FFT algorithm interpolates a degree n – 1 polynomialgiven values at each of the nth roots of unity in O(n log n) steps.

IFFT : Summery and Algorithem

Page 24: FFT and DFT algorithm

May 1, 2023 By:Muhammad Umer Javed 24

Polynomial : Summery

Runs 2 FFT for two polynomials with time

Runs 1 IFFTfor one polynomials with time

Runs multiplecations

Ordanery multiplecation