5.6 Convolution and FFT

Size: px
Start display at page:

Download "5.6 Convolution and FFT"

Transcription

1 5.6 Convolution and FFT

2 Fast Fourier Transform: Applications Applications. Optics, acoustics, quantum physics, telecommunications, control systems, signal processing, speech recognition, data compression, image processing. DVD, JPEG, MP3, MRI, CAT scan. Numerical solutions to Poisson's equation. The FFT is one of the truly great computational developments of this [20th] century. It has changed the face of science and engineering so much that it is not an exaggeration to say that life as we know it would be very different without the FFT. -Charles van Loan 3

3 Fast Fourier Transform: Brief History Gauss (1805, 1866). Analyzed periodic motion of asteroid Ceres. Runge-König (1924). Laid theoretical groundwork. Danielson-Lanczos (1942). Efficient algorithm. Cooley-Tukey (1965). Monitoring nuclear tests in Soviet Union and tracking submarines. Rediscovered and popularized FFT. Importance not fully realized until advent of digital computers. 4

4 Polynomials: Coefficient Representation Polynomial. [coefficient representation] A(x) = a 0 + a 1 x + a 2 x 2 +L+ a n 1 x n 1 B(x) = b 0 + b 1 x + b 2 x 2 +L+ b n 1 x n 1 Add: O(n) arithmetic operations. A(x)+ B(x) = (a 0 +b 0 )+(a 1 +b 1 )x +L+ (a n 1 +b n 1 )x n 1 Evaluate: O(n) using Horner's method. A(x) = a 0 +(x(a 1 + x(a 2 +L+ x(a n 2 + x(a n 1 ))L)) Multiply (convolve): O(n 2 ) using brute force. A(x) B(x) = 2n 2 c i x i, where c i = a j b i j i =0 i j =0 5

5 Polynomials: Point-Value Representation Fundamental theorem of algebra. [Gauss, PhD thesis] A degree n polynomial with complex coefficients has n complex roots. Corollary. A degree n-1 polynomial A(x) is uniquely specified by its evaluation at n distinct values of x. y y j = A(x j ) x j x 6

6 Polynomials: Point-Value Representation Polynomial. [point-value representation] A(x) : (x 0, y 0 ), K, (x n-1, y n 1 ) B(x) : (x 0, z 0 ), K, (x n-1, z n 1 ) Add: O(n) arithmetic operations. A(x)+ B(x) : (x 0, y 0 + z 0 ),K, (x n-1, y n 1 + z n 1 ) Multiply: O(n), but need 2n-1 points. A(x) B(x) : (x 0, y 0 z 0 ),K, (x 2n-1, y 2n 1 z 2n 1 ) Evaluate: O(n 2 ) using Lagrange's formula. (x x j ) n 1 j k A(x) = y k (x k x j ) k=0 j k 7

7 Converting Between Two Polynomial Representations Tradeoff. Fast evaluation or fast multiplication. We want both! Representation Coefficient Multiply O(n 2 ) Evaluate O(n) Point-value O(n) O(n 2 ) Goal. Make all ops fast by efficiently converting between two representations. a 0, a 1,K, a n-1 (x 0, y 0 ), K, (x n 1, y n 1 ) coefficient representation point-value representation 8

8 Converting Between Two Polynomial Representations: Brute Force Coefficient to point-value. Given a polynomial a 0 + a 1 x a n-1 x n-1, evaluate it at n distinct points x 0,..., x n-1. y 0 y 1 y 2 M y n 1 = 2 1 x 0 x 0 L 2 1 x 1 x 1 L 2 1 x 2 x 2 L M M M O M L 2 1 x n 1 x n 1 x 0 n 1 x 1 n 1 x 2 n 1 n 1 x n 1 a 0 a 1 a 2 M a n 1 O(n 2 ) for matrix-vector multiply O(n 3 ) for Gaussian elimination Vandermonde matrix is invertible iff x i distinct Point-value to coefficient. Given n distinct points x 0,..., x n-1 and values y 0,..., y n-1, find unique polynomial a 0 + a 1 x a n-1 x n-1 that has given values at given points. 9

9 Coefficient to Point-Value Representation: Intuition Coefficient to point-value. Given a polynomial a 0 + a 1 x a n-1 x n-1, evaluate it at n distinct points x 0,..., x n-1. Divide. Break polynomial up into even and odd powers. A(x) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + a 4 x 4 + a 5 x 5 + a 6 x 6 + a 7 x 7. A even (x) = a 0 + a 2 x + a 4 x 2 + a 6 x 3. A odd (x) = a 1 + a 3 x + a 5 x 2 + a 7 x 3. A(-x) = A even (x 2 ) + x A odd (x 2 ). A(-x) = A even (x 2 ) - x A odd (x 2 ). Intuition. Choose two points to be ±1. A(-1) = A even (1) + 1 A odd (1). A(-1) = A even (1) - 1 A odd (1). Can evaluate polynomial of degree n at 2 points by evaluating two polynomials of degree ½n at 1 point. 10

10 Coefficient to Point-Value Representation: Intuition Coefficient to point-value. Given a polynomial a 0 + a 1 x a n-1 x n-1, evaluate it at n distinct points x 0,..., x n-1. Divide. Break polynomial up into even and odd powers. A(x) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + a 4 x 4 + a 5 x 5 + a 6 x 6 + a 7 x 7. A even (x) = a 0 + a 2 x + a 4 x 2 + a 6 x 3. A odd (x) = a 1 + a 3 x + a 5 x 2 + a 7 x 3. A(-x) = A even (x 2 ) + x A odd (x 2 ). A(-x) = A even (x 2 ) - x A odd (x 2 ). Intuition. Choose four points to be ±1, ±i. A(-1) = A even (-1) + 1 A odd ( 1). A(-1) = A even (-1) - 1 A odd (-1). A(-i) = A even (-1) + i A odd (-1). A(-i) = A even (-1) - i A odd (-1). Can evaluate polynomial of degree n at 4 points by evaluating two polynomials of degree ½n at 2 points. 11

11 Discrete Fourier Transform Coefficient to point-value. Given a polynomial a 0 + a 1 x a n-1 x n-1, evaluate it at n distinct points x 0,..., x n-1. Key idea: choose x k = ω k where ω is principal n th root of unity. y 0 y 1 y 2 y 3 M y n 1 = L 1 1 ω 1 ω 2 ω 3 L ω n 1 1 ω 2 ω 4 ω 6 L ω 2(n 1) 1 ω 3 ω 6 ω 9 L ω 3(n 1) M M M M O M 1 ω n 1 ω 2(n 1) ω 3(n 1) L ω (n 1)(n 1) a 0 a 1 a 2 a 3 M a n 1 Discrete Fourier transform Fourier matrix F n 12

12 Roots of Unity Def. An n th root of unity is a complex number x such that x n = 1. Fact. The n th roots of unity are: ω 0, ω 1,, ω n-1 where ω = e 2π i / n. Pf. (ω k ) n = (e 2π i k / n ) n = (e π i ) 2k = (-1) 2k = 1. Fact. The ½n th roots of unity are: ν 0, ν 1,, ν n/2-1 where ν = e 4π i / n. Fact. ω 2 = ν and (ω 2 ) k = ν k. ω 2 = ν 1 = i ω 3 ω 1 ω 4 = ν 2 = -1 n = 8 ω 0 = ν 0 = 1 ω 5 ω 7 ω 6 = ν 3 = -i 13

13 Fast Fourier Transform Goal. Evaluate a degree n-1 polynomial A(x) = a a n-1 x n-1 at its n th roots of unity: ω 0, ω 1,, ω n-1. Divide. Break polynomial up into even and odd powers. A even (x) = a 0 + a 2 x + a 4 x a n/2-2 x (n-1)/2. A odd (x) = a 1 + a 3 x + a 5 x a n/2-1 x (n-1)/2. A(x) = A even (x 2 ) + x A odd (x 2 ). Conquer. Evaluate degree A even (x) and A odd (x) at the ½n th roots of unity: ν 0, ν 1,, ν n/2-1. Combine. A(ω k+n ) = A even (ν k ) + ω k A odd (ν k ), 0 k < n/2 A(ω k+n ) = A even (ν k ) - ω k A odd (ν k ), 0 k < n/2 ν k = (ω k ) 2 = (ω k+n ) 2 ω k+n = -ω k 14

14 FFT Algorithm fft(n, a 0,a 1,,a n-1 ) { if (n == 1) return a 0 (e 0,e 1,,e n/2-1 ) FFT(n/2, a 0,a 2,a 4,,a n-2 ) (d 0,d 1,,d n/2-1 ) FFT(n/2, a 1,a 3,a 5,,a n-1 ) for k = 0 to n/2-1 { ω k e 2πik/n y k+n/2 e k + ω k d k } y k+n/2 e k - ω k d k } return (y 0,y 1,,y n-1 ) 15

15 FFT Summary Theorem. FFT algorithm evaluates a degree n-1 polynomial at each of the n th roots of unity in O(n log n) steps. assumes n is a power of 2 Running time. T(2n) = 2T(n) + O(n) T(n) = O(n log n). O(n log n) a 0, a 1,K, a n-1 (ω 0, y 0 ), K, (ω n 1, y n 1 ) coefficient representation point-value representation 16

16 Recursion Tree a 0, a 1, a 2, a 3, a 4, a 5, a 6, a 7 perfect shuffle a 0, a 2, a 4, a 6 a 1, a 3, a 5, a 7 a 0, a 4 a 2, a 6 a 1, a 5 a 3, a 7 a 0 a 4 a 2 a 6 a 1 a 5 a 3 a "bit-reversed" order 17

17 Point-Value to Coefficient Representation: Inverse DFT Goal. Given the values y 0,..., y n-1 of a degree n-1 polynomial at the n points ω 0, ω 1,, ω n-1, find unique polynomial a 0 + a 1 x a n-1 x n-1 that has given values at given points. a 0 a 1 a 2 a 3 M a n 1 = L 1 1 ω 1 ω 2 ω 3 L ω n 1 1 ω 2 ω 4 ω 6 L ω 2(n 1) 1 ω 3 ω 6 ω 9 L ω 3(n 1) M M M M O M 1 ω n 1 ω 2(n 1) ω 3(n 1) L ω (n 1)(n 1) y 0 y 1 y 2 y 3 M y n 1 Inverse DFT Fourier matrix inverse (F n ) -1 18

18 Inverse FFT Claim. Inverse of Fourier matrix is given by following formula. G n = 1 n L 1 1 ω 1 ω 2 ω 3 L ω (n 1) 1 ω 2 ω 4 ω 6 L ω 2(n 1) 1 ω 3 ω 6 ω 9 L ω 3(n 1) M M M M O M 1 ω (n 1) ω 2(n 1) ω 3(n 1) L ω (n 1)(n 1) Consequence. To compute inverse FFT, apply same algorithm but use ω -1 = e -2π i / n as principal n th root of unity (and divide by n). 19

19 Inverse FFT: Proof of Correctness Claim. F n and G n are inverses. Pf. ( F n G n ) k k = 1 n n 1 ω k j ω j k = 1 n j=0 n 1 ω (k k ) j j=0 = 1 if k = k 0 otherwise summation lemma Summation lemma. Let ω be a principal n th root of unity. Then n 1 ω k j j=0 = n if k 0 mod n 0 otherwise Pf. If k is a multiple of n then ω k = 1 sums to n. Each n th root of unity ω k is a root of x n - 1 = (x - 1) (1 + x + x x n-1 ). if ω k 1 we have: 1 + ω k + ω k(2) ω k(n-1) = 0 sums to 0. 20

20 Inverse FFT: Algorithm ifft(n, a 0,a 1,,a n-1 ) { if (n == 1) return a 0 (e 0,e 1,,e n/2-1 ) FFT(n/2, a 0,a 2,a 4,,a n-2 ) (d 0,d 1,,d n/2-1 ) FFT(n/2, a 1,a 3,a 5,,a n-1 ) for k = 0 to n/2-1 { } ω k e -2πik/n y k+n/2 (e k + ω k d k ) / n y k+n/2 (e k - ω k d k ) / n } return (y 0,y 1,,y n-1 ) 21

21 Inverse FFT Summary Theorem. Inverse FFT algorithm interpolates a degree n-1 polynomial given values at each of the n th roots of unity in O(n log n) steps. assumes n is a power of 2 O(n log n) a 0, a 1,K, a n-1 (ω 0, y 0 ), K, (ω n 1, y n 1 ) coefficient representation O(n log n) point-value representation 22

22 Polynomial Multiplication Theorem. Can multiply two degree n-1 polynomials in O(n log n) steps. coefficient representation coefficient representation a 0, a 1,K, a n-1 b 0, b 1,K, b n-1 c 0, c 1,K, c 2n-2 FFT O(n log n) inverse FFT O(n log n) A(x 0 ),K, A(x 2n-1 ) point-value multiplication B(x 0 ),K, B(x 2n-1 ) C(x 0 ), C(x 1 ),K, C(x 2n-1 ) O(n) 23

23 FFT in Practice Fastest Fourier transform in the West. [Frigo and Johnson] Optimized C library. Features: DFT, DCT, real, complex, any size, any dimension. Won 1999 Wilkinson Prize for Numerical Software. Portable, competitive with vendor-tuned code. Implementation details. Instead of executing predetermined algorithm, it evaluates your hardware and uses a special-purpose compiler to generate an optimized algorithm catered to "shape" of the problem. Core algorithm is nonrecursive version of Cooley-Tukey radix 2 FFT. O(n log n), even for prime sizes. Reference: 24

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 14 Divide and Conquer Fast Fourier Transform Sofya Raskhodnikova 10/7/2016 S. Raskhodnikova; based on slides by K. Wayne. 5.6 Convolution and FFT Fast Fourier Transform:

More information

How to Multiply. 5.5 Integer Multiplication. Complex Multiplication. Integer Arithmetic. Complex multiplication. (a + bi) (c + di) = x + yi.

How to Multiply. 5.5 Integer Multiplication. Complex Multiplication. Integer Arithmetic. Complex multiplication. (a + bi) (c + di) = x + yi. How to ultiply Slides by Kevin Wayne. Copyright 5 Pearson-Addison Wesley. All rights reserved. integers, matrices, and polynomials Complex ultiplication Complex multiplication. a + bi) c + di) = x + yi.

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 5 Divide and Conquer: Fast Fourier Transform Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms

More information

DIVIDE AND CONQUER II

DIVIDE AND CONQUER II DIVIDE AND CONQUER II master theorem integer multiplication matrix multiplication convolution and FFT Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos

More information

The Fast Fourier Transform. Andreas Klappenecker

The Fast Fourier Transform. Andreas Klappenecker The Fast Fourier Transform Andreas Klappenecker Motivation There are few algorithms that had more impact on modern society than the fast Fourier transform and its relatives. The applications of the fast

More information

DIVIDE AND CONQUER II

DIVIDE AND CONQUER II DIVIDE AND CONQUER II master theorem integer multiplication matrix multiplication convolution and FFT SECTION 5.6 Fourier analysis Fourier theorem. [Fourier, Dirichlet, Riemann] Any sufficiently smooth)

More information

FFT: Fast Polynomial Multiplications

FFT: Fast Polynomial Multiplications FFT: Fast Polynomial Multiplications Jie Wang University of Massachusetts Lowell Department of Computer Science J. Wang (UMass Lowell) FFT: Fast Polynomial Multiplications 1 / 20 Overview So far we have

More information

Chapter 5. Divide and Conquer. CS 350 Winter 2018

Chapter 5. Divide and Conquer. CS 350 Winter 2018 Chapter 5 Divide and Conquer CS 350 Winter 2018 1 Divide-and-Conquer Divide-and-conquer. Break up problem into several parts. Solve each part recursively. Combine solutions to sub-problems into overall

More information

The Fast Fourier Transform: A Brief Overview. with Applications. Petros Kondylis. Petros Kondylis. December 4, 2014

The Fast Fourier Transform: A Brief Overview. with Applications. Petros Kondylis. Petros Kondylis. December 4, 2014 December 4, 2014 Timeline Researcher Date Length of Sequence Application CF Gauss 1805 Any Composite Integer Interpolation of orbits of celestial bodies F Carlini 1828 12 Harmonic Analysis of Barometric

More information

Computational Methods CMSC/AMSC/MAPL 460

Computational Methods CMSC/AMSC/MAPL 460 Computational Methods CMSC/AMSC/MAPL 460 Fourier transform Balaji Vasan Srinivasan Dept of Computer Science Several slides from Prof Healy s course at UMD Last time: Fourier analysis F(t) = A 0 /2 + A

More information

DIVIDE AND CONQUER II

DIVIDE AND CONQUER II DIVIDE AND CONQUER II master theorem integer multiplication matrix multiplication convolution and FFT DIVIDE AND CONQUER II master theorem integer multiplication matrix multiplication convolution and FFT

More information

CS711008Z Algorithm Design and Analysis

CS711008Z Algorithm Design and Analysis CS711008Z Algorithm Design and Analysis Lecture 5 FFT and Divide and Conquer Dongbo Bu Institute of Computing Technology Chinese Academy of Sciences, Beijing, China 1 / 56 Outline DFT: evaluate a polynomial

More information

CS S Lecture 5 January 29, 2019

CS S Lecture 5 January 29, 2019 CS 6363.005.19S Lecture 5 January 29, 2019 Main topics are #divide-and-conquer with #fast_fourier_transforms. Prelude Homework 1 is due Tuesday, February 5th. I hope you ve at least looked at it by now!

More information

DIVIDE AND CONQUER II

DIVIDE AND CONQUER II DIVIDE AND CONQUER II DIVIDE AND CONQUER II master theorem integer multiplication matrix multiplication convolution and FFT master theorem integer multiplication matrix multiplication convolution and FFT

More information

Fast Fourier Transform

Fast Fourier Transform Why Fourier Transform? Fast Fourier Transform Jordi Cortadella and Jordi Petit Department of Computer Science Polynomials: coefficient representation Divide & Conquer Dept. CS, UPC Polynomials: point-value

More information

CSE 421 Algorithms. T(n) = at(n/b) + n c. Closest Pair Problem. Divide and Conquer Algorithms. What you really need to know about recurrences

CSE 421 Algorithms. T(n) = at(n/b) + n c. Closest Pair Problem. Divide and Conquer Algorithms. What you really need to know about recurrences CSE 421 Algorithms Richard Anderson Lecture 13 Divide and Conquer What you really need to know about recurrences Work per level changes geometrically with the level Geometrically increasing (x > 1) The

More information

Fast Convolution; Strassen s Method

Fast Convolution; Strassen s Method Fast Convolution; Strassen s Method 1 Fast Convolution reduction to subquadratic time polynomial evaluation at complex roots of unity interpolation via evaluation at complex roots of unity 2 The Master

More information

Sequential Fast Fourier Transform (PSC ) Sequential FFT

Sequential Fast Fourier Transform (PSC ) Sequential FFT Sequential Fast Fourier Transform (PSC 3.1 3.2) 1 / 18 Applications of Fourier analysis Fourier analysis studies the decomposition of functions into their frequency components. Piano Concerto no. 9 by

More information

Chapter 1 Divide and Conquer Polynomial Multiplication Algorithm Theory WS 2015/16 Fabian Kuhn

Chapter 1 Divide and Conquer Polynomial Multiplication Algorithm Theory WS 2015/16 Fabian Kuhn Chapter 1 Divide and Conquer Polynomial Multiplication Algorithm Theory WS 2015/16 Fabian Kuhn Formulation of the D&C principle Divide-and-conquer method for solving a problem instance of size n: 1. Divide

More information

E The Fast Fourier Transform

E The Fast Fourier Transform Fourier Transform Methods in Finance By Umberto Cherubini Giovanni Della Lunga Sabrina Mulinacci Pietro Rossi Copyright 2010 John Wiley & Sons Ltd E The Fast Fourier Transform E.1 DISCRETE FOURIER TRASFORM

More information

Fast Polynomial Multiplication

Fast Polynomial Multiplication Fast Polynomial Multiplication Marc Moreno Maza CS 9652, October 4, 2017 Plan Primitive roots of unity The discrete Fourier transform Convolution of polynomials The fast Fourier transform Fast convolution

More information

How to Write Fast Numerical Code

How to Write Fast Numerical Code How to Write Fast Numerical Code Lecture: Discrete Fourier transform, fast Fourier transforms Instructor: Markus Püschel TA: Georg Ofenbeck & Daniele Spampinato Rest of Semester Today Lecture Project meetings

More information

The tangent FFT. D. J. Bernstein University of Illinois at Chicago

The tangent FFT. D. J. Bernstein University of Illinois at Chicago The tangent FFT D. J. Bernstein University of Illinois at Chicago Advertisement SPEED: Software Performance Enhancement for Encryption and Decryption A workshop on software speeds for secret-key cryptography

More information

Divide and Conquer algorithms

Divide and Conquer algorithms Divide and Conquer algorithms Another general method for constructing algorithms is given by the Divide and Conquer strategy. We assume that we have a problem with input that can be split into parts in

More information

CSE 548: Analysis of Algorithms. Lecture 4 ( Divide-and-Conquer Algorithms: Polynomial Multiplication )

CSE 548: Analysis of Algorithms. Lecture 4 ( Divide-and-Conquer Algorithms: Polynomial Multiplication ) CSE 548: Analysis of Algorithms Lecture 4 ( Divide-and-Conquer Algorithms: Polynomial Multiplication ) Rezaul A. Chowdhury Department of Computer Science SUNY Stony Brook Spring 2015 Coefficient Representation

More information

How to Write Fast Numerical Code Spring 2012 Lecture 19. Instructor: Markus Püschel TAs: Georg Ofenbeck & Daniele Spampinato

How to Write Fast Numerical Code Spring 2012 Lecture 19. Instructor: Markus Püschel TAs: Georg Ofenbeck & Daniele Spampinato How to Write Fast Numerical Code Spring 2012 Lecture 19 Instructor: Markus Püschel TAs: Georg Ofenbeck & Daniele Spampinato Miscellaneous Roofline tool Project report etc. online Midterm (solutions online)

More information

Integer multiplication with generalized Fermat primes

Integer multiplication with generalized Fermat primes Integer multiplication with generalized Fermat primes CARAMEL Team, LORIA, University of Lorraine Supervised by: Emmanuel Thomé and Jérémie Detrey Journées nationales du Calcul Formel 2015 (Cluny) November

More information

Algorithms and data structures

Algorithms and data structures Algorithms and data structures Amin Coja-Oghlan LFCS Complex numbers Roots of polynomials A polynomial of degree d is a function of the form p(x) = d a i x i with a d 0. i=0 There are at most d numbers

More information

Periodic motions. Periodic motions are known since the beginning of mankind: Motion of planets around the Sun; Pendulum; And many more...

Periodic motions. Periodic motions are known since the beginning of mankind: Motion of planets around the Sun; Pendulum; And many more... Periodic motions Periodic motions are known since the beginning of mankind: Motion of planets around the Sun; Pendulum; And many more... Periodic motions There are several quantities which describe a periodic

More information

Multiplying huge integers using Fourier transforms

Multiplying huge integers using Fourier transforms Fourier transforms October 25, 2007 820348901038490238478324 1739423249728934932894??? integers occurs in many fields of Computational Science: Cryptography Number theory... Traditional approaches to

More information

Interpolation on the unit circle

Interpolation on the unit circle Lecture 2: The Fast Discrete Fourier Transform Interpolation on the unit circle So far, we have considered interpolation of functions at nodes on the real line. When we model periodic phenomena, it is

More information

Lecture 20: Discrete Fourier Transform and FFT

Lecture 20: Discrete Fourier Transform and FFT EE518 Digital Signal Processing University of Washington Autumn 2001 Dept of Electrical Engineering Lecture 20: Discrete Fourier Transform and FFT Dec 10, 2001 Prof: J Bilmes TA:

More information

Fast Polynomials Multiplication Using FFT

Fast Polynomials Multiplication Using FFT Li Chen lichen.xd at gmail.com Xidian University January 17, 2014 Outline 1 Discrete Fourier Transform (DFT) 2 Discrete Convolution 3 Fast Fourier Transform (FFT) 4 umber Theoretic Transform (TT) 5 More

More information

Chapter 5 Divide and Conquer

Chapter 5 Divide and Conquer CMPT 705: Design and Analysis of Algorithms Spring 008 Chapter 5 Divide and Conquer Lecturer: Binay Bhattacharya Scribe: Chris Nell 5.1 Introduction Given a problem P with input size n, P (n), we define

More information

Transforms and Orthogonal Bases

Transforms and Orthogonal Bases Orthogonal Bases Transforms and Orthogonal Bases We now turn back to linear algebra to understand transforms, which map signals between different domains Recall that signals can be interpreted as vectors

More information

4.3 The Discrete Fourier Transform (DFT) and the Fast Fourier Transform (FFT)

4.3 The Discrete Fourier Transform (DFT) and the Fast Fourier Transform (FFT) CHAPTER. TIME-FREQUECY AALYSIS: FOURIER TRASFORMS AD WAVELETS.3 The Discrete Fourier Transform (DFT and the Fast Fourier Transform (FFT.3.1 Introduction In this section, we discuss some of the mathematics

More information

18.085: Summer 2016 Due: 3 August 2016 (in class) Problem Set 8

18.085: Summer 2016 Due: 3 August 2016 (in class) Problem Set 8 Problem Set 8 Unless otherwise specified, you may use MATLAB to assist with computations. provide a print-out of the code used and its output with your assignment. Please 1. More on relation between Fourier

More information

CS483 Design and Analysis of Algorithms

CS483 Design and Analysis of Algorithms CS483 Design and Analysis of Algorithms Lecture 6-8 Divide and Conquer Algorithms Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments

More information

Mid-term Exam Answers and Final Exam Study Guide CIS 675 Summer 2010

Mid-term Exam Answers and Final Exam Study Guide CIS 675 Summer 2010 Mid-term Exam Answers and Final Exam Study Guide CIS 675 Summer 2010 Midterm Problem 1: Recall that for two functions g : N N + and h : N N +, h = Θ(g) iff for some positive integer N and positive real

More information

Chapter 1 Divide and Conquer Algorithm Theory WS 2016/17 Fabian Kuhn

Chapter 1 Divide and Conquer Algorithm Theory WS 2016/17 Fabian Kuhn Chapter 1 Divide and Conquer Algorithm Theory WS 2016/17 Fabian Kuhn Formulation of the D&C principle Divide-and-conquer method for solving a problem instance of size n: 1. Divide n c: Solve the problem

More information

Radix-4 Factorizations for the FFT with Ordered Input and Output

Radix-4 Factorizations for the FFT with Ordered Input and Output Radix-4 Factorizations for the FFT with Ordered Input and Output Vikrant 1, Ritesh Vyas 2, Sandeep Goyat 3, Jitender Kumar 4, Sandeep Kaushal 5 YMCA University of Science & Technology, Faridabad (Haryana),

More information

ELEG 305: Digital Signal Processing

ELEG 305: Digital Signal Processing ELEG 5: Digital Signal Processing Lecture 6: The Fast Fourier Transform; Radix Decimatation in Time Kenneth E. Barner Department of Electrical and Computer Engineering University of Delaware Fall 8 K.

More information

Problem Set 8 - Solution

Problem Set 8 - Solution Problem Set 8 - Solution Jonasz Słomka Unless otherwise specified, you may use MATLAB to assist with computations. provide a print-out of the code used and its output with your assignment. Please 1. More

More information

Toeplitz matrices. Niranjan U N. May 12, NITK, Surathkal. Definition Toeplitz theory Computational aspects References

Toeplitz matrices. Niranjan U N. May 12, NITK, Surathkal. Definition Toeplitz theory Computational aspects References Toeplitz matrices Niranjan U N NITK, Surathkal May 12, 2010 Niranjan U N (NITK, Surathkal) Linear Algebra May 12, 2010 1 / 15 1 Definition Toeplitz matrix Circulant matrix 2 Toeplitz theory Boundedness

More information

Sequential Fast Fourier Transform

Sequential Fast Fourier Transform Sequential Fast Fourier Transform Departement Computerwetenschappen Room 03.018 (Celestijnenlaan 200A) albert-jan.yzelman@cs.kuleuven.be Includes material from slides by Prof. dr. Rob H. Bisseling Applications

More information

Divide and Conquer: Polynomial Multiplication Version of October 1 / 7, 24201

Divide and Conquer: Polynomial Multiplication Version of October 1 / 7, 24201 Divide and Conquer: Polynomial Multiplication Version of October 7, 2014 Divide and Conquer: Polynomial Multiplication Version of October 1 / 7, 24201 Outline Outline: Introduction The polynomial multiplication

More information

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. Prof. R. Fateman

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. Prof. R. Fateman UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division CS 282 Spring, 2000 Prof. R. Fateman The (finite field) Fast Fourier Transform 0. Introduction

More information

COMS E F15. Lecture 22: Linearity Testing Sparse Fourier Transform

COMS E F15. Lecture 22: Linearity Testing Sparse Fourier Transform COMS E6998-9 F15 Lecture 22: Linearity Testing Sparse Fourier Transform 1 Administrivia, Plan Thu: no class. Happy Thanksgiving! Tue, Dec 1 st : Sergei Vassilvitskii (Google Research) on MapReduce model

More information

The tangent FFT. Daniel J. Bernstein

The tangent FFT. Daniel J. Bernstein The tangent FFT Daniel J. Bernstein Department of Mathematics, Statistics, and Computer Science (M/C 249) University of Illinois at Chicago, Chicago, IL 60607 7045, USA djb@cr.yp.to Abstract. The split-radix

More information

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn Randomization Randomized Algorithm: An algorithm that uses (or can use) random coin flips in order to make decisions We will see: randomization

More information

Algorithms and Data Structures

Algorithms and Data Structures Charles A. Wuethrich Bauhaus-University Weimar - CogVis/MMC June 1, 2017 1/44 Space reduction mechanisms Range searching Elementary Algorithms (2D) Raster Methods Shell sort Divide and conquer Quicksort

More information

Old and new algorithms for computing Bernoulli numbers

Old and new algorithms for computing Bernoulli numbers Old and new algorithms for computing Bernoulli numbers University of New South Wales 25th September 2012, University of Ballarat Bernoulli numbers Rational numbers B 0, B 1,... defined by: x e x 1 = n

More information

Fast Fourier Transform

Fast Fourier Transform Fast Fourier Transform December 8, 2016 FFT JPEG RGB Y C B C R (luma (brightness), chroma 2 (color)) chroma resolution is reduced image is split in blocks 8 8 pixels JPEG RGB Y C B C R (luma (brightness),

More information

Fast Multipole Methods: Fundamentals & Applications. Ramani Duraiswami Nail A. Gumerov

Fast Multipole Methods: Fundamentals & Applications. Ramani Duraiswami Nail A. Gumerov Fast Multipole Methods: Fundamentals & Applications Ramani Duraiswami Nail A. Gumerov Week 1. Introduction. What are multipole methods and what is this course about. Problems from physics, mathematics,

More information

arithmetic properties of weighted catalan numbers

arithmetic properties of weighted catalan numbers arithmetic properties of weighted catalan numbers Jason Chen Mentor: Dmitry Kubrak May 20, 2017 MIT PRIMES Conference background: catalan numbers Definition The Catalan numbers are the sequence of integers

More information

Computer Vision, Convolutions, Complexity and Algebraic Geometry

Computer Vision, Convolutions, Complexity and Algebraic Geometry Computer Vision, Convolutions, Complexity and Algebraic Geometry D. V. Chudnovsky, G.V. Chudnovsky IMAS Polytechnic Institute of NYU 6 MetroTech Center Brooklyn, NY 11201 December 6, 2012 Fast Multiplication:

More information

MATH 350: Introduction to Computational Mathematics

MATH 350: Introduction to Computational Mathematics MATH 350: Introduction to Computational Mathematics Chapter VIII: The Fast Fourier Transform Greg Fasshauer Department of Applied Mathematics Illinois Institute of Technology Spring 2008 Outline 1 The

More information

Frequency Domain Finite Field Arithmetic for Elliptic Curve Cryptography

Frequency Domain Finite Field Arithmetic for Elliptic Curve Cryptography Frequency Domain Finite Field Arithmetic for Elliptic Curve Cryptography Selçuk Baktır, Berk Sunar {selcuk,sunar}@wpi.edu Department of Electrical & Computer Engineering Worcester Polytechnic Institute

More information

Kartsuba s Algorithm and Linear Time Selection

Kartsuba s Algorithm and Linear Time Selection CS 374: Algorithms & Models of Computation, Fall 2015 Kartsuba s Algorithm and Linear Time Selection Lecture 09 September 22, 2015 Chandra & Manoj (UIUC) CS374 1 Fall 2015 1 / 32 Part I Fast Multiplication

More information

Lecture 3: Divide and Conquer: Fast Fourier Transform

Lecture 3: Divide and Conquer: Fast Fourier Transform Lecture 3: Divide ad Coquer: Fast Fourier Trasform Polyomial Operatios vs. Represetatios Divide ad Coquer Algorithm Collapsig Samples / Roots of Uity FFT, IFFT, ad Polyomial Multiplicatio Polyomial operatios

More information

The Discrete Fourier transform

The Discrete Fourier transform 453.70 Linear Systems, S.M. Tan, The University of uckland 9- Chapter 9 The Discrete Fourier transform 9. DeÞnition When computing spectra on a computer it is not possible to carry out the integrals involved

More information

Frequency-domain representation of discrete-time signals

Frequency-domain representation of discrete-time signals 4 Frequency-domain representation of discrete-time signals So far we have been looing at signals as a function of time or an index in time. Just lie continuous-time signals, we can view a time signal as

More information

Sparse Fourier Transform (lecture 1)

Sparse Fourier Transform (lecture 1) 1 / 73 Sparse Fourier Transform (lecture 1) Michael Kapralov 1 1 IBM Watson EPFL St. Petersburg CS Club November 2015 2 / 73 Given x C n, compute the Discrete Fourier Transform (DFT) of x: x i = 1 x n

More information

The New Largest Known Prime is 2 p 1 With p = Who Cares? Sam Wagstaff Computer Sciences and Mathematics.

The New Largest Known Prime is 2 p 1 With p = Who Cares? Sam Wagstaff Computer Sciences and Mathematics. The New Largest Known Prime is 2 p 1 With p = 74207281. Who Cares? Sam Wagstaff Computer Sciences and Mathematics November 10, 2016 Earlier in 2016, Cooper, Woltman, Kurowski, Blosser and GIMPS found this

More information

Today. Polynomials. Secret Sharing.

Today. Polynomials. Secret Sharing. Today. Polynomials. Secret Sharing. A secret! I have a secret! A number from 0 to 10. What is it? Any one of you knows nothing! Any two of you can figure it out! Example Applications: Nuclear launch: need

More information

Discrete Fourier Transform

Discrete Fourier Transform Discrete Fourier Transform Valentina Hubeika, Jan Černocký DCGM FIT BUT Brno, {ihubeika,cernocky}@fit.vutbr.cz Diskrete Fourier transform (DFT) We have just one problem with DFS that needs to be solved.

More information

Lecture 7 January 26, 2016

Lecture 7 January 26, 2016 MATH 262/CME 372: Applied Fourier Analysis and Winter 26 Elements of Modern Signal Processing Lecture 7 January 26, 26 Prof Emmanuel Candes Scribe: Carlos A Sing-Long, Edited by E Bates Outline Agenda:

More information

EDISP (NWL3) (English) Digital Signal Processing DFT Windowing, FFT. October 19, 2016

EDISP (NWL3) (English) Digital Signal Processing DFT Windowing, FFT. October 19, 2016 EDISP (NWL3) (English) Digital Signal Processing DFT Windowing, FFT October 19, 2016 DFT resolution 1 N-point DFT frequency sampled at θ k = 2πk N, so the resolution is f s/n If we want more, we use N

More information

Speedy Maths. David McQuillan

Speedy Maths. David McQuillan Speedy Maths David McQuillan Basic Arithmetic What one needs to be able to do Addition and Subtraction Multiplication and Division Comparison For a number of order 2 n n ~ 100 is general multi precision

More information

Number theoretic algorithms for cryptographic applications

Number theoretic algorithms for cryptographic applications Number theoretic algorithms for cryptographic applications Sandeep Sen 1 March 16, 2009 1 Department of Computer Science and Engineering, IIT Delhi, New Delhi 110016, India. E-mail:ssen@cse.iitd.ernet.in

More information

Divide and Conquer. Maximum/minimum. Median finding. CS125 Lecture 4 Fall 2016

Divide and Conquer. Maximum/minimum. Median finding. CS125 Lecture 4 Fall 2016 CS125 Lecture 4 Fall 2016 Divide and Conquer We have seen one general paradigm for finding algorithms: the greedy approach. We now consider another general paradigm, known as divide and conquer. We have

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 12 Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002. Reproduction permitted for noncommercial,

More information

CS168: The Modern Algorithmic Toolbox Lecture #11: The Fourier Transform and Convolution

CS168: The Modern Algorithmic Toolbox Lecture #11: The Fourier Transform and Convolution CS168: The Modern Algorithmic Toolbox Lecture #11: The Fourier Transform and Convolution Tim Roughgarden & Gregory Valiant May 8, 2015 1 Intro Thus far, we have seen a number of different approaches to

More information

23. The Finite Fourier Transform and the Fast Fourier Transform Algorithm

23. The Finite Fourier Transform and the Fast Fourier Transform Algorithm 23. The Finite Fourier Transform and the Fast Fourier Transform Algorithm 23.1 Introduction: Fourier Series Early in the Nineteenth Century, Fourier studied sound and oscillatory motion and conceived of

More information

(x + 1)(x 2) = 4. x

(x + 1)(x 2) = 4. x dvanced Integration Techniques: Partial Fractions The method of partial fractions can occasionally make it possible to find the integral of a quotient of rational functions. Partial fractions gives us

More information

The Fast Fourier Transform

The Fast Fourier Transform The Fast Fourier Transform A Mathematical Perspective Todd D. Mateer Contents Chapter 1. Introduction 3 Chapter 2. Polynomials 17 1. Basic operations 17 2. The Remainder Theorem and Synthetic Division

More information

Fig. 1: Fourier series Examples

Fig. 1: Fourier series Examples FOURIER SERIES AND ITS SOME APPLICATIONS P. Sathyabama Assistant Professor, Department of Mathematics, Bharath collage of Science and Management, Thanjavur, Tamilnadu Abstract: The Fourier series, the

More information

Faster arithmetic for number-theoretic transforms

Faster arithmetic for number-theoretic transforms University of New South Wales 7th October 2011, Macquarie University Plan for talk 1. Review number-theoretic transform (NTT) 2. Discuss typical butterfly algorithm 3. Improvements to butterfly algorithm

More information

arxiv:math/ v1 [math.na] 12 Jul 2004

arxiv:math/ v1 [math.na] 12 Jul 2004 arxiv:math/0407177v1 [math.na] 12 Jul 2004 On improving the accuracy of Horner s and Goertzel s algorithms Alica Smoktunowicz and Iwona Wróbel Faculty of Mathematics and Information Science, Warsaw University

More information

Solving the general quadratic congruence. y 2 Δ (mod p),

Solving the general quadratic congruence. y 2 Δ (mod p), Quadratic Congruences Solving the general quadratic congruence ax 2 +bx + c 0 (mod p) for an odd prime p (with (a, p) = 1) is equivalent to solving the simpler congruence y 2 Δ (mod p), where Δ = b 2 4ac

More information

Optimization of new Chinese Remainder theorems using special moduli sets

Optimization of new Chinese Remainder theorems using special moduli sets Louisiana State University LSU Digital Commons LSU Master's Theses Graduate School 2010 Optimization of new Chinese Remainder theorems using special moduli sets Narendran Narayanaswamy Louisiana State

More information

DIGITAL SIGNAL PROCESSING UNIT I

DIGITAL SIGNAL PROCESSING UNIT I DIGITAL SIGNAL PROCESSING UNIT I CONTENTS 1.1 Introduction 1.2 Introduction about signals 1.3 Signals Processing 1.4 Classification of signals 1.5 Operations performed on signals 1.6 Properties of signals

More information

Parallelism in Computer Arithmetic: A Historical Perspective

Parallelism in Computer Arithmetic: A Historical Perspective Parallelism in Computer Arithmetic: A Historical Perspective 21s 2s 199s 198s 197s 196s 195s Behrooz Parhami Aug. 218 Parallelism in Computer Arithmetic Slide 1 University of California, Santa Barbara

More information

Lecture 01 August 31, 2017

Lecture 01 August 31, 2017 Sketching Algorithms for Big Data Fall 2017 Prof. Jelani Nelson Lecture 01 August 31, 2017 Scribe: Vinh-Kha Le 1 Overview In this lecture, we overviewed the six main topics covered in the course, reviewed

More information

Compute the Fourier transform on the first register to get x {0,1} n x 0.

Compute the Fourier transform on the first register to get x {0,1} n x 0. CS 94 Recursive Fourier Sampling, Simon s Algorithm /5/009 Spring 009 Lecture 3 1 Review Recall that we can write any classical circuit x f(x) as a reversible circuit R f. We can view R f as a unitary

More information

Lecture 2: Number Representations (2)

Lecture 2: Number Representations (2) Lecture 2: Number Representations (2) ECE 645 Computer Arithmetic 1/29/08 ECE 645 Computer Arithmetic Lecture Roadmap Number systems (cont'd) Floating point number system representations Residue number

More information

The Fast Fourier Transform

The Fast Fourier Transform The Fast Fourier Transform 1 Motivation: digital signal processing The fast Fourier transform (FFT) is the workhorse of digital signal processing To understand how it is used, consider any signal: any

More information

E.J. Barbeau. Polynomials. With 36 Illustrations. Springer

E.J. Barbeau. Polynomials. With 36 Illustrations. Springer E.J. Barbeau Polynomials With 36 Illustrations Springer Contents Preface Acknowledgment of Problem Sources vii xiii 1 Fundamentals 1 /l.l The Anatomy of a Polynomial of a Single Variable 1 1.1.5 Multiplication

More information

x 9 or x > 10 Name: Class: Date: 1 How many natural numbers are between 1.5 and 4.5 on the number line?

x 9 or x > 10 Name: Class: Date: 1 How many natural numbers are between 1.5 and 4.5 on the number line? 1 How many natural numbers are between 1.5 and 4.5 on the number line? 2 How many composite numbers are between 7 and 13 on the number line? 3 How many prime numbers are between 7 and 20 on the number

More information

Implementing Fast Carryless Multiplication

Implementing Fast Carryless Multiplication Implementing Fast Carryless Multiplication Joris van der Hoeven, Robin Larrieu and Grégoire Lecerf CNRS & École polytechnique MACIS 2017 Nov. 15, Vienna, Austria van der Hoeven, Larrieu, Lecerf Implementing

More information

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn Randomization Randomized Algorithm: An algorithm that uses (or can use) random coin flips in order to make decisions We will see: randomization

More information

! Break up problem into several parts. ! Solve each part recursively. ! Combine solutions to sub-problems into overall solution.

! Break up problem into several parts. ! Solve each part recursively. ! Combine solutions to sub-problems into overall solution. Divide-and-Conquer Chapter 5 Divide and Conquer Divide-and-conquer.! Break up problem into several parts.! Solve each part recursively.! Combine solutions to sub-problems into overall solution. Most common

More information

Space- and Time-Efficient Polynomial Multiplication

Space- and Time-Efficient Polynomial Multiplication Space- and Time-Efficient Polynomial Multiplication Daniel S. Roche Symbolic Computation Group School of Computer Science University of Waterloo ISSAC 2009 Seoul, Korea 30 July 2009 Univariate Polynomial

More information

An Introduction and Analysis of the Fast Fourier Transform. Thao Nguyen Mentor: Professor Ron Buckmire

An Introduction and Analysis of the Fast Fourier Transform. Thao Nguyen Mentor: Professor Ron Buckmire An Introduction and Analysis of the Fast Fourier Transform Thao Nguyen Mentor: Professor Ron Buckmire Outline 1. Outline of the Talk 2. Continuous Fourier Transform (CFT) Visualization of the CFT Mathematical

More information

Parallel Integer Polynomial Multiplication Changbo Chen, Svyatoslav Parallel Integer Covanov, Polynomial FarnamMultiplication

Parallel Integer Polynomial Multiplication Changbo Chen, Svyatoslav Parallel Integer Covanov, Polynomial FarnamMultiplication Parallel Integer Polynomial Multiplication Parallel Integer Polynomial Multiplication Changbo Chen 1 Svyatoslav Covanov 2,3 Farnam Mansouri 2 Marc Moreno Maza 2 Ning Xie 2 Yuzhen Xie 2 1 Chinese Academy

More information

Review 1. 1 Relations and Functions. Review Problems

Review 1. 1 Relations and Functions. Review Problems Review 1 1 Relations and Functions Objectives Relations; represent a relation by coordinate pairs, mappings and equations; functions; evaluate a function; domain and range; operations of functions. Skills

More information

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same

More information

University of the Virgin Islands, St. Thomas January 14, 2015 Algorithms and Programming for High Schoolers. Lecture 5

University of the Virgin Islands, St. Thomas January 14, 2015 Algorithms and Programming for High Schoolers. Lecture 5 University of the Virgin Islands, St. Thomas January 14, 2015 Algorithms and Programming for High Schoolers Numerical algorithms: Lecture 5 Today we ll cover algorithms for various numerical problems:

More information

MA3232 Numerical Analysis Week 9. James Cooley (1926-)

MA3232 Numerical Analysis Week 9. James Cooley (1926-) MA umerical Analysis Week 9 James Cooley (96-) James Cooley is an American mathematician. His most significant contribution to the world of mathematics and digital signal processing is the Fast Fourier

More information

Math 312/ AMS 351 (Fall 17) Sample Questions for Final

Math 312/ AMS 351 (Fall 17) Sample Questions for Final Math 312/ AMS 351 (Fall 17) Sample Questions for Final 1. Solve the system of equations 2x 1 mod 3 x 2 mod 7 x 7 mod 8 First note that the inverse of 2 is 2 mod 3. Thus, the first equation becomes (multiply

More information