Richard Fateman CS 282 Lecture 101 The Finite-Field FFT Lecture 10.

Slides:



Advertisements
Similar presentations
Rules of Matrix Arithmetic
Advertisements

Fast Fourier Transform for speeding up the multiplication of polynomials an Algorithm Visualization Alexandru Cioaca.
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Polynomial and FFT. Topics 1. Problem 2. Representation of polynomials 3. The DFT and FFT 4. Efficient FFT implementations 5. Conclusion.
Fast Fourier Transform Lecture 6 Spoken Language Processing Prof. Andrew Rosenberg.
Infinite Horizon Problems
Richard Fateman CS 282 Lecture 21 Basic Domains of Interest used in Computer Algebra Systems Lecture 2.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
Lecture #17 INTRODUCTION TO THE FAST FOURIER TRANSFORM ALGORITHM Department of Electrical and Computer Engineering Carnegie Mellon University Pittsburgh,
Richard Fateman CS 282 Lecture 31 Operations, representations Lecture 3.
FFT1 The Fast Fourier Transform by Jorge M. Trabal.
Faster Multiplication, Powering of Polynomials
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Fast Fourier Transform Jean Baptiste Joseph Fourier ( ) These lecture.
Richard Fateman CS 282 Lecture 111 Determinants Lecture 11.
Richard Fateman CS 282 Lecture 51 Faster Multiplication, Powering of Polynomials Lecture 5.
Richard Fateman CS 282 Lecture 31 Operations, representations Lecture 3.
CSE 421 Algorithms Richard Anderson Lecture 13 Divide and Conquer.
Cs h Polynomials1 A Review of Polynomial Representations and Arithmetic in Computer Algebra Systems Richard Fateman University of California Berkeley.
Introduction to Algorithms
ON MULTIVARIATE POLYNOMIAL INTERPOLATION
Richard Fateman CS 282 Lecture 61 Evaluation/Interpolation (I) Lecture 6.
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.
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.
Copyright © 2011 Pearson Education, Inc. Sequences Section 8.1 Sequences, Series, and Probability.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
1 Section 5.5 Solving Recurrences Any recursively defined function ƒ with domain N that computes numbers is called a recurrence or recurrence relation.
5.6 Convolution and FFT. 2 Fast Fourier Transform: Applications Applications. n Optics, acoustics, quantum physics, telecommunications, control systems,
Algorithms and their Applications CS2004 ( ) Dr Stephen Swift 3.1 Mathematical Foundation.
The Fast Fourier Transform
Advanced Algebraic Algorithms on Integers and Polynomials Prepared by John Reif, Ph.D. Analysis of Algorithms.
Week 12 - Wednesday.  What did we talk about last time?  Asymptotic notation.
Karatsuba’s Algorithm for Integer Multiplication
1 Markov Decision Processes Infinite Horizon Problems Alan Fern * * Based in part on slides by Craig Boutilier and Daniel Weld.
Great Theoretical Ideas in Computer Science.
Applied Symbolic Computation1 Applied Symbolic Computation (CS 300) Karatsuba’s Algorithm for Integer Multiplication Jeremy R. Johnson.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
The Fast Fourier Transform and Applications to Multiplication
1 Markov Decision Processes Infinite Horizon Problems Alan Fern * * Based in part on slides by Craig Boutilier and Daniel Weld.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
1 Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Applied Symbolic Computation1 Applied Symbolic Computation (CS 567) The Fast Fourier Transform (FFT) and Convolution Jeremy R. Johnson TexPoint fonts used.
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
Hardware Implementations of Finite Field Primitives
2 2.2 © 2016 Pearson Education, Ltd. Matrix Algebra THE INVERSE OF A MATRIX.
3/18/2016Mr. Santowski - Calculus1 Lesson 31 (Day 2) - Limits Calculus - Mr Santowski.
May 9, 2001Applied Symbolic Computation1 Applied Symbolic Computation (CS 680/480) Lecture 6: Multiplication, Interpolation, and the Chinese Remainder.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Polynomial + Fast Fourier Transform
Applied Symbolic Computation
September 4, 1997 Applied Symbolic Computation (CS 300) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Polynomials and the FFT(UNIT-3)
Applied Symbolic Computation
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.
The Fast Fourier Transform
Advanced Algorithms Analysis and Design
Applied Symbolic Computation
September 4, 1997 Applied Symbolic Computation (CS 567) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Applied Symbolic Computation
Applied Symbolic Computation
Numerical Analysis Lecture10.
Transform and Conquer Transform and Conquer Transform and Conquer.
Transform and Conquer Transform and Conquer Transform and Conquer.
The Fast Fourier Transform
MA5242 Wavelets Lecture 1 Numbers and Vector Spaces
Applied Symbolic Computation
Fast Polynomial and Integer Multiplication
Presentation transcript:

Richard Fateman CS 282 Lecture 101 The Finite-Field FFT Lecture 10

Richard Fateman CS 282 Lecture 102 Intro

Richard Fateman CS 282 Lecture 103 If we knew {a i } ahead of time we could pre- process the coefficients

Richard Fateman CS 282 Lecture 104 Simultaneous Evaluation at Many Points If we keep the polynomial fixed, and evaluate at many points, we can do better, as we will see. For specificity in notation, let us evaluate A(x) at n given points, x 0,..., x n-1. Let us represent the problem as a matrix multiplication: Is this perfectly clear?

Richard Fateman CS 282 Lecture 105 Roots of Unity It is especially convenient for subsequent operations to choose the points specially: Definition:  n is a primitive n th root of unity in a computation structure (e.g. finite field), if  n n = 1 but for no m such that 0 < m < n is  n m = 1. Examples: In the finite field of the integers mod 41 ( { Z} 41 ), the element 3 is a primitive 8 th root of unity. In Z 3 the element 2 is a square-root of unity, since 2 2 = 4 ´ 1 mod 3. Over the complex numbers,  n = e 2  i / n.

Richard Fateman CS 282 Lecture 106 Definition of Fourier Transform Definition: A Fourier Transform (FT) is a sequence of n points constituting the evaluation of a polynomial with coefficients { a 0,..., a n-1 } at the points {  0,...,  n-1 } where  is a primitive n th root of unity. That is, the Fourier Transform can be thought of as the left hand side of the equation on the next slide.

Richard Fateman CS 282 Lecture 107 FT is “just” a matrix multiplication stop here and understand this. for convenience we will denote it this way

Richard Fateman CS 282 Lecture 108 Computing Let n be even = 2k.

Richard Fateman CS 282 Lecture 109 Computing

Richard Fateman CS 282 Lecture 1010 Computing We have accomplished a 2k Fourier Transform with 2 size k Fourier Transforms plus some O(n) operations and powerings of  (which can be precomputed).

Richard Fateman CS 282 Lecture 1011 How fast is this FFT? A principal item of interest is the running time for the FFT. If the time to perform an FFT of size 2k is T(2k), then from our expression above, T(2k)=2T(k)+O(k ). Iterating this formula gives (where r=log 2 k): T(2k)=2 r T(1) + O(rk)= O(n log n). Thus this trick reduces the O(n 2 ) algorithm (of n applications of Horner's rule), to O(n log n) operations. This is a very good speedup, and was allegedly known by Gauss and others, until it was popularized by Cooley and Tukey.

Richard Fateman CS 282 Lecture 1012 We have to be able to invert the FFT = Interpolation! That is, we are given a set of evaluation points (powers of a root of unity) and asked to provide a polynomial which assumes given values at those points. The inverse of F n is a matrix G n where the (i,j) th element is  n -ij /n, where we have, somewhat unconventionally, numbered the rows and columns so that the 0,0 element is at the top left.

Richard Fateman CS 282 Lecture 1013 The Inverse of F n It looks rather like F n with  -1 in place of , and with a 1/n out front. So whatever computation structure we have needs to allow us to compute 1/n, as well as have roots of unity we can use.

Richard Fateman CS 282 Lecture 1014 Proof that I = F n G n

Richard Fateman CS 282 Lecture 1015 How hard is it to find primitive roots of unity? Not hard.

Richard Fateman CS 282 Lecture 1016 How many of these can we find?

Richard Fateman CS 282 Lecture 1017 The algorithm, written simply, recursively

Richard Fateman CS 282 Lecture 1018 The insides:

Richard Fateman CS 282 Lecture 1019 Can the FFT be improved? Basically, it continues to be a major industry to come up with improved designs, variations and implementations of the FFT. is the home page for the fastest FFT “in the West”. Limitations that can be modified: power of 2, (vs power of 3 or product-of primes) in-place transforms, cache performance.

Richard Fateman CS 282 Lecture 1020 Since I usually badmouth asymptotic results, is this practical (e.g. for polynomials)? Yes: Enough of the time that it has been implemented in a few systems. No: It is not the default for any computer algebra system. Probably not fast enough for routinely-small routinely-sparse routinely many- variables. Coefficients must be bounded in some effective way. Other techniques (e.g. Karatsuba) sometimes prevail.

Richard Fateman CS 282 Lecture 1021 Benchmark One benchmark set up to favor FFTs suggest that computing f(x) 2 where f is a dense polynomial over a single-precision-size finite field, is best done by FFT only if deg(f)>96. How favored? 1.(x+1) 96 has many “bignum” coefficients, so a real comparison might need 3 or 4 FFTs + CRA + bound computation. 2.For f(x) sparse, FFTs would do almost as much work, but the competition would not.