Upload
umer-javed
View
182
Download
5
Embed Size (px)
Citation preview
FFT & DFT
A Divide and Conquer 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
May 1, 2023 By:Muhammad Umer Javed 3
Signal. [touch tone button 1]
Time domain.
Frequency domain.
Time domain vs. frequency domain
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
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
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
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
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
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
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.
May 1, 2023 By:Muhammad Umer Javed 11
Example
Equation
May 1, 2023 By:Muhammad Umer Javed 12
DISCRETE FOURIER TRANSFORM
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 =
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
𝒗𝒌=(𝝎𝒌+𝟏𝟐 𝒏)𝟐 𝝎𝒌+(𝟏𝟐 )𝒏
=−𝝎𝒌
May 1, 2023 By:Muhammad Umer Javed 15
For each k
• for DFT• for FFT …….
How! lets see
As where
Fast Fourier Transform
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?
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
May 1, 2023 By:Muhammad Umer Javed 18
When equation becomes FFT: Example
May 1, 2023 By:Muhammad Umer Javed 19
FFTFor indices where
So we get
also
DFT of even samples DFT of odd
samples
But
May 1, 2023 By:Muhammad Umer Javed 20
FFT: Algorithem
May 1, 2023 By:Muhammad Umer Javed 21
FFT : Algorithem
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
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
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