1 / 21

Introduction to Algorithms

Introduction to Algorithms. Polynomials and the FFT My T. Thai @ UF. Polynomials. A polynomial in the variable x : Polynomial addition Polynomial multiplication where. Representing polynomials.

Download Presentation

Introduction to Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Algorithms Polynomials and the FFT My T. Thai @ UF

  2. Polynomials • A polynomial in the variable x: • Polynomial addition • Polynomial multiplication • where My T. Thai mythai@cise.ufl.edu

  3. Representing polynomials • Acoefficient representation of a polynomial d of degree bound n is a vector of coefficients • Horner’s rule to compute A(x0) Time: O(n) • Given a = , b = • Sum: c = a + b, takes O(n) time • Product: c = (convolution of a and b), takes O(n2) time My T. Thai mythai@cise.ufl.edu

  4. Representing polynomials • A point-value representation of a polynomial A(x) of degree-bound n is a set of n point-value pairs d • All of the xk are distinct Proof: Da = y |D| = => a = D-1y Vandermonde matrix My T. Thai mythai@cise.ufl.edu

  5. Operations in point-value representation A : B : • Addition: C: • Multiplication: • Extend A, B to 2n points: • Product: My T. Thai mythai@cise.ufl.edu

  6. Fast multiplication of polynomials in coefficient form • Evaluation: coefficient representation  point-value representation • Interpolation: point-value representation coefficient form of a polynomial My T. Thai mythai@cise.ufl.edu

  7. Compute evaluation and interpolation • Evaluation: using Hornermethod takes O(n2) => not good • Interpolation: computing inversion of Vandermonde matrix takes O(n3) time => not good • How to complete evaluation and interpolation in O(n log n) time? • Choose evaluation points: complex roots of unity • Use Discrete Fourier Transform for evaluation • Use inverse Discrete Fourier Transform for interpolation My T. Thai mythai@cise.ufl.edu

  8. Complex roots of unity • A complex nth root of unity is a complex number such that • There are exactly n complex nth roots of unity • Principal nth root of unity • All other complex nth roots of unity are powers of My T. Thai mythai@cise.ufl.edu

  9. Properties of unity’s Complex roots Proof: My T. Thai mythai@cise.ufl.edu

  10. Halving lemma • Proof: • Cancellation lemma: My T. Thai mythai@cise.ufl.edu

  11. Summation lemma Proof: • Note: • k is not divisible by n • only when k • is divisible by n My T. Thai mythai@cise.ufl.edu

  12. Discrete Fourier Transform • Given: • The values of A at evaluation points • Vector is discrete Fourier transform (DFT) of the coefficient vector d . Denote My T. Thai mythai@cise.ufl.edu

  13. Fast Fourier Transform • DivideA into two polynomials based on the even-indexed and odd-indexed coefficients: • Combine: • Evaluation points of A[0] and A[1] are actually the n/2th roots of unity My T. Thai mythai@cise.ufl.edu

  14. Fast Fourier Transform Time: My T. Thai mythai@cise.ufl.edu

  15. Inversion of Vandermonde matrix Proof: My T. Thai mythai@cise.ufl.edu

  16. Interpolation at the complex roots of unity • Compute by modifying FFT algorithm • Switch the roles of a and y • Replace • Divide each element by n My T. Thai mythai@cise.ufl.edu

  17. FFT and Polynomial mutiplication My T. Thai mythai@cise.ufl.edu

  18. Efficient FFT implementations • Line 10 – 12: change the loop to compute only once storing it in t ( Butterfly operation) Butterfly operation My T. Thai mythai@cise.ufl.edu

  19. Structure of RECURSIVE-FFT • Each RECURSIVE-FFT invocation makes two recursive calls • Arrange the elements of a into the order in which they appear in the leaves ( take log n for each element) • Compute bottom up My T. Thai mythai@cise.ufl.edu

  20. An iterative FFT implementation Time: My T. Thai mythai@cise.ufl.edu

  21. A parallel FFT circuit My T. Thai mythai@cise.ufl.edu

More Related