Lecture 16 Fast Fourier Transform

Slides:



Advertisements
Similar presentations
Fast Fourier Transform for speeding up the multiplication of polynomials an Algorithm Visualization Alexandru Cioaca.
Advertisements

-FFT Recap (or, what am I expected to know?) - Learning Finite State Environments Avrim Blum 11/25/03.
Instructor Neelima Gupta Table of Contents Divide and Conquer.
Dr. Deshi Ye Divide-and-conquer Dr. Deshi Ye
Instructor: Shengyu Zhang 1. Example 1: Merge sort 2.
Fast Fourier Transform Lecture 6 Spoken Language Processing Prof. Andrew Rosenberg.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
Administrative Oct. 2 Oct. 4 – QUIZ #2 (pages of DPV)
Richard Fateman CS 282 Lecture 101 The Finite-Field FFT Lecture 10.
CSE 421 Algorithms Richard Anderson Lecture 15 Fast Fourier Transform.
FFT(Fast Fourier Transform). p2. FFT Coefficient representation: How to evaluate A(x 0 )?
FFT1 The Fast Fourier Transform by Jorge M. Trabal.
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Fast Fourier Transform Jean Baptiste Joseph Fourier ( ) These lecture.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 16: Application-Driven Hardware Acceleration (1/4)
CSE 421 Algorithms Richard Anderson Lecture 13 Divide and Conquer.
Introduction to Algorithms
The Fourier series A large class of phenomena can be described as periodic in nature: waves, sounds, light, radio, water waves etc. It is natural to attempt.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 14 Instructor: Paul Beame.
Equivalent Fractions Equivalent Fractions Using Cross-Multiplication.
Fast Fourier Transform Irina Bobkova. Overview I. Polynomials II. The DFT and FFT III. Efficient implementations IV. Some problems.
1 Chapter 5 Divide and Conquer Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Fingerprinting techniques. 2 Is X equal to Y? = ? = ?
CS 6068 Parallel Computing Fall 2013 Lecture 10 – Nov 18 The Parallel FFT Prof. Fred Office Hours: MWF.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
5.6 Convolution and FFT. 2 Fast Fourier Transform: Applications Applications. n Optics, acoustics, quantum physics, telecommunications, control systems,
The Fast Fourier Transform
Karatsuba’s Algorithm for Integer Multiplication
Applied Symbolic Computation1 Applied Symbolic Computation (CS 300) Karatsuba’s Algorithm for Integer Multiplication Jeremy R. Johnson.
The Fast Fourier Transform and Applications to Multiplication
1 Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
CSE 421 Algorithms Lecture 15 Closest Pair, Multiplication.
POLYNOMIALS 9/20/2015. STANDARD FORM OF A POLYNOMIAL ax + bx + cx … mx + k nn-1n-2 The degree is ‘n’
PreCalculus Section 2.6 Solve polynomial equations by factoring and the Rational Roots Theorem. Solve by factoring: x 3 + 5x 2 – 4x – 20 = 0 x 6 – x 3.
Applied Symbolic Computation1 Applied Symbolic Computation (CS 567) The Fast Fourier Transform (FFT) and Convolution Jeremy R. Johnson TexPoint fonts used.
Aims: To understand what a polynomial is To be able to add and subtract polynomials To be able to multiply polynomials Polynomials/Factorisation Lesson.
May 9, 2001Applied Symbolic Computation1 Applied Symbolic Computation (CS 680/480) Lecture 6: Multiplication, Interpolation, and the Chinese Remainder.
Algebra 2cc Section 2.10 Identify and evaluate polynomials A polynomial function is an expression in the form: f(x) = ax n + bx n-1 + cx n-2 + … dx + e.
Chapter 2 Divide-and-Conquer algorithms
Chapter 2 Divide-and-Conquer algorithms
ECE 1304 Introduction to Electrical and Computer Engineering
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Polynomial + Fast Fourier Transform
6.5. A Summation Method Asume that:
Applied Symbolic Computation
September 4, 1997 Applied Symbolic Computation (CS 300) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Applied Symbolic Computation
Polynomials and the FFT(UNIT-3)
Applied Symbolic Computation
FAST FOURIER TRANSFORM ALGORITHMS
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 =
September 4, 1997 Applied Symbolic Computation (CS 300) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Punya Biswas Lecture 15 Closest Pair, Multiplication
The Fast Fourier Transform
Advanced Algorithms Analysis and Design
Taylor and Maclaurin Series
Applied Symbolic Computation
Applied Symbolic Computation
September 4, 1997 Applied Symbolic Computation (CS 567) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Chapter 5 Divide and Conquer
Applied Symbolic Computation
7.6 Powers and Roots of Complex Numbers
Richard Anderson Lecture 14 Inversions, Multiplication, FFT
Applied Symbolic Computation
Dynamic Programming Shortest Paths with Negative Weights Yin Tat Lee
Polynomial and Rational Functions
5.5 – Completing the Square
The Fast Fourier Transform
Complex Numbers and i is the imaginary unit
Applied Symbolic Computation
Fast Polynomial and Integer Multiplication
Presentation transcript:

Lecture 16 Fast Fourier Transform CSE 421 Algorithms Lecture 16 Fast Fourier Transform Slides from 2006, A different slide deck will be used for the 2009 lecture

FFT, Convolution and Polynomial Multiplication FFT: O(n log n) algorithm Evaluate a polynomial of degree n at n points in O(n log n) time Polynomial Multiplication: O(n log n) time

Complex Analysis Polar coordinates: reqi eqi = cos q + i sin q a is an nth root of unity if an = 1 Square roots of unity: +1, -1 Fourth roots of unity: +1, -1, i, -i Eighth roots of unity: +1, -1, i, -i, b + ib, b - ib, -b + ib, -b - ib where b = sqrt(2)

e2pki/n e2pi = 1 epi = -1 nth roots of unity: e2pki/n for k = 0 …n-1 Notation: wk,n = e2pki/n Interesting fact: 1 + wk,n + w2k,n + w3k,n + . . . + wn-1k,n = 0 for k != 0

FFT Overview Polynomial interpolation Given n+1 points (xi,yi), there is a unique polynomial P of degree at most n which satisfies P(xi) = yi

Polynomial Multiplication n-1 degree polynomials A(x) = a0 + a1x + a2x2 + … +an-1xn-1, B(x) = b0 + b1x + b2x2 + …+ bn-1xn-1 C(x) = A(x)B(x) C(x)=c0+c1x + c2x2 + … + c2n-2x2n-2 p1, p2, . . ., p2n A(p1), A(p2), . . ., A(p2n) B(p1), B(p2), . . ., B(p2n) C(p1), C(p2), . . ., C(p2n) C(pi) = A(pi)B(pi)

FFT Polynomial A(x) = a0 + a1x + . . . + an-1xn-1 Compute A(wj,n) for j = 0, . . ., n-1 For simplicity, n is a power of 2

Useful trick A(x) = a0 + a1x + a2x2 + a3x3 +. . . + an-1xn-1 Aeven(x) = a0 + a2x + a4x2 + . . . + an-2x(n-2)/2 Aodd(x) = a1+ a3x + a5x2 + …+ an-1x(n-2)/2 Show: A(x) = Aeven(x2) + x Aodd(x2)

Lemma: w2j,2n = wj,n wj,2n = e2pji/2n Squares of 2nth roots of unity are nth roots of unity wj,2n = e2pji/2n The detail of j >= n is being ignored – don’t mention unless it comes up.

FFT Algorithm // Evaluate the 2n-1th degree polynomial A at // w0,2n, w1,2n, w2,2n, . . ., w2n-1,2n FFT(A, 2n) Recursively compute FFT(Aeven, n) Recursively compute FFT(Aodd, n) for j = 0 to 2n-1 A(wj,2n) = Aeven(w2j,2n) + wj,2nAodd(w2j,2n)

Polynomial Multiplication n-1th degree polynomials A and B Evaluate A and B at w0,2n, w1,2n, . . ., w2n-1,2n Compute C(wj,2n) for j = 0 to 2n -1 We know the value of a 2n-2th degree polynomial at 2n points – this determines a unique polynomial, we just need to determine the coefficients

Now the magic happens . . . C(x) = c0 + c1x + c2x2 + … + c2n-1x2n-1 (we want to compute the ci’s) Let dj = C(wj,2n) D(x) = d0 + d1x + d2x2 + … + d2n-1x2n-1 Evaluate D(x) at the 2nth roots of unity D(wj,2n) = [see text for details] = 2nc2n-j

Polynomial Interpolation Build polynomial from the values of C at the 2nth roots of unity Evaluate this polynomial at the 2nth roots of unity