Computational Methods CMSC/AMSC/MAPL 460

Similar documents
Computational Methods CMSC/AMSC/MAPL 460. Fourier transform

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

Sequential Fast Fourier Transform (PSC ) Sequential FFT

Design and Analysis of Algorithms

5.6 Convolution and FFT

The Fast Fourier Transform. Andreas Klappenecker

Algorithm Design and Analysis

Sequential Fast Fourier Transform

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

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

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

The O () notation. Definition: Let f(n), g(n) be functions of the natural (or real)

CS711008Z Algorithm Design and Analysis

Lecture 20: Discrete Fourier Transform and FFT

Fall 2011, EE123 Digital Signal Processing

Fast Fourier Transform

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

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

E The Fast Fourier Transform

Divide and Conquer algorithms

If s is a character that labels one of the buttons on the key pad, the corresponding row index k and column index j can be found with

Scientific Computing: An Introductory Survey

DIVIDE AND CONQUER II

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

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

Multiplying huge integers using Fourier transforms

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

Transforms and Orthogonal Bases

EE123 Digital Signal Processing

Fast Fourier Transform

MATH 350: Introduction to Computational Mathematics

Outline. Introduction

Parallel Numerical Algorithms

Fig. 1: Fourier series Examples

Response to Periodic and Non-periodic Loadings. Giacomo Boffi. March 25, 2014

Lecture 5. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

CS S Lecture 5 January 29, 2019

FFT: Fast Polynomial Multiplications

DCSP-2: Fourier Transform

lecture 7: Trigonometric Interpolation

Fast Fourier Transformation

THE FAST FOURIER TRANSFORM III 10.3

Response to Periodic and Non-periodic Loadings. Giacomo Boffi.

Tutorial 2 - Learning about the Discrete Fourier Transform

Section X.55. Cyclotomic Extensions

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

In this Lecture. Frequency domain analysis

Interpolation on the unit circle

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

Fast Multipole Methods

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

SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

Lecture 7 January 26, 2016

BME 50500: Image and Signal Processing in Biomedicine. Lecture 2: Discrete Fourier Transform CCNY

MARN 5898 Fourier Analysis.

Lecture 01 August 31, 2017

THE FOURIER TRANSFORM (Fourier series for a function whose period is very, very long) Reading: Main 11.3

Lecture 7. Fourier Analysis

Fourier analysis of discrete-time signals. (Lathi Chapt. 10 and these slides)

Introduction to Fourier Analysis Part 2. CS 510 Lecture #7 January 31, 2018

DISCRETE FOURIER TRANSFORM

Today s lecture. The Fourier transform. Sampling, aliasing, interpolation The Fast Fourier Transform (FFT) algorithm

EE482: Digital Signal Processing Applications

Discrete Fourier Transform

Computational Methods for Astrophysics: Fourier Transforms

Lecture 1: Center for Uncertainty Quantification. Alexander Litvinenko. Computation of Karhunen-Loeve Expansion:

Fast Polynomial Multiplication

ECE 595, Section 10 Numerical Simulations Lecture 12: Applications of FFT. Prof. Peter Bermel February 6, 2013

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

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

DSP Algorithm Original PowerPoint slides prepared by S. K. Mitra

Lecture4 INF-MAT : 5. Fast Direct Solution of Large Linear Systems

Introduction to HPC. Lecture 20

The Fast Fourier Transform

Chapter 4 Discrete Fourier Transform (DFT) And Signal Spectrum

sinc function T=1 sec T=2 sec angle(f(w)) angle(f(w))

Algorithms to solve block Toeplitz systems and. least-squares problems by transforming to Cauchy-like. matrices

The divide-and-conquer strategy solves a problem by: 1. Breaking it into subproblems that are themselves smaller instances of the same type of problem

Elliptic Curves Spring 2013 Lecture #3 02/12/2013

5th-order differentiation

Fast Convolution; Strassen s Method

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

Tutorial 4. Fast Fourier Transforms Phase factors runs around on the unit circle contains Wave forms

The Fast Fourier Transform


The Fourier transform allows an arbitrary function to be represented in terms of simple sinusoids. The Fourier transform (FT) of a function f(t) is

Summary of lecture 1. E x = E x =T. X T (e i!t ) which motivates us to define the energy spectrum Φ xx (!) = jx (i!)j 2 Z 1 Z =T. 2 d!

Lecture 4 Filtering in the Frequency Domain. Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016

MORE CONSEQUENCES OF CAUCHY S THEOREM

CSE548, AMS542: Analysis of Algorithms, Fall 2017 Date: October 11. In-Class Midterm. ( 7:05 PM 8:20 PM : 75 Minutes )

The divide-and-conquer strategy solves a problem by: Chapter 2. Divide-and-conquer algorithms. Multiplication

1 Singular Value Decomposition

Definition. A signal is a sequence of numbers. sequence is also referred to as being in l 1 (Z), or just in l 1. A sequence {x(n)} satisfying

multiply both sides of eq. by a and projection overlap

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

12.1 Fourier Transform of Discretely Sampled Data

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

FOURIER SERIES, HAAR WAVELETS AND FAST FOURIER TRANSFORM

Discrete Time Fourier Transform (DTFT)

Periodic functions: simple harmonic oscillator

Transcription:

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 1 Cos( t) + A 2 Cos(2 t) + A 3 Cos(3 t) + + B 1 Sin( t) + B 2 Sin(2 t) + B 3 Sin(3 t) + = A 0 /2 + A 1 Cos( t) + i (-ib 1 ) Sin( t) + A 2 Cos(2 t) + i (-ib 2 ) Sin(2 t) + = F 0 + F 1 e -it + F 2 e -2it + F k = (1/p) 0 p f(t) e - 2 π i k t/p dt

Last time: Discrete Fourier Transform f(t) φ[n] ; F(k) Φ[k] Discrete Fourier Transform: p F k = (1/p) 0 f(t) e - 2 π i k t/p dt N-1 Φ[k] =1/N Σ φ[n] e -2 π i k n h /N Inverse Discrete Fourier Transform: N-1 n =0 φ[n] = Σ Φ[k] e 2 π i k n /N k=0

Discrete time Numerical Fourier Analysis DFT is really just a matrix multiplication! Φ[0] Φ[1] Φ[2] Φ[N-1] Φ [κ] = 1/Ν = Freq index ex60 50 40 30 20 10 0 N-1 Σ m =0 e time index Φ = F N -2 π i k m/n φ[m] 0 10 20 30 40 50 60 φ[0] φ[1] φ[2] φ[n-1] φ

Numerical Harmonic Analysis FFT: Symmetry Properties permits Divide and Conquer Sparse Factorization 15000 12500 10000 7500 5000 2500 60 50 40 30 20 10 0 0 10 20 30 40 50 60 F n Naive FFT 20 40 60 80 100 120

Structured matrices Fast algorithms have been found for many dense matrices Typically the matrices have some structure Definition: A dense matrix of order N N is called structured if its entries depend on only O(N) parameters Most famous example the fast Fourier transform

Fourier Matrices

i = 1 Primitive Roots of Unity A number ω is a primitive n-th root of unity, for n>1, if ω n = 1 The numbers 1, ω, ω 2,, ω n-1 are all distinct Example: The complex number e 2pi/n is a primitive n-th root of unity, where Check: if properties are satisfied w 4 w 3 w 2 Imaginary 2πi w 2 45 o cos(π/4) w 1 =cos(π/4) + i w 8 Real 1 n 1 ω = e 1 n 2 i n π n 2πi 2 ω = e = e = cos 2π + i sin 2π = 1 n 1 jp 0 j 2 j 3 j j( n 1) 3 S= ω = ω + ω + ω + ω + + ω = 0 p= 0 w 5 w 6 w 7 n complex roots of unity equally spaced around the circle of unit radius centered at the origin of the complex plane

Roots of Unity: Properties Property 1: Let ω be the principal n th root of unity If n > 0, then ω n/2 = -1 Proof: ω = e 2π i / n ω n/2 = e π i = -1 (Euler's formula) Reflective Property: Corollary: ω k+n/2 = -ω k Property 2: Let n > 0 be even, and let ω and ν be the principal n th and (n/2) th roots of unity Then (ω k ) 2 = ν k Proof: (ω k ) 2 = e (2k)2π i / n = e (k) 2π i / (n / 2) = ν k Reduction Property: If ω is a primitive (2n)-th root of unity, then ω 2 is a primitive n-th root of unity

L3: Let n > 0 be even Then, the squares of the n complex n th roots of unity are the n/2 complex (n/2) th roots of unity Proof: If we square all of the n th roots of unity, then each (n/2) th root is obtained exactly twice since: L1 ω k + n / 2 = - ω k thus, (ω k + n / 2 ) 2 = (ω k ) 2 L2 both of these = ν k ω k + n / 2 and ω k have the same square Inverse Property: If ω is a primitive root of unity, then ω -1 =ω n-1 Proof: ωω n-1 =ω n =1

Fast Fourier Transform Presented by Cooley and Tukey in 1965, but invented several times, including by Gauss (1809) and Danielson & Lanczos (1948) Danielson Lanczos lemma

So far we have seen what happens on the right hand side How about the left hand side? When we split the sums in two we have two sets of sums with N/2 quantities for N points So the complexity is N 2 /2 + N 2 /2 =N 2 So there is no improvement Φ[0] Φ[1] Φ[2] Φ[N-1] = 50 40 30 Freq index60 20 10 0 time index 0 10 20 30 40 50 60 φ[0] φ[1] φ[2] φ[n-1]

Need to reduce the number of sums on the left hand side We need to reduce the number of sums computed from 2N to a lower number Notice that the values corresponding to k and k+n/2 will be the same The transforms F ek and F ok are periodic in k with length N/2 So we need only compute half of them! 1 08 06 04 02 1 2 3 4 5 6 7 8 9 10 1112 1314 1516 1718 1920 21

FFT So DFT of order N can be expressed as sum of two DFTs of order N/2 evaluated at N/2 points Does this improve the complexity? Yes (N/2) 2 +(N/2) 2 =N 2 /2< N 2 But we are not done Can apply the lemma recursively Finally we have a set of one point transforms One point transform is identity

FFT Algorithm FFT (n, a 0, a 1, a 2,, a n-1 ) if (n == 1) // n is a power of 2 return a 0 ω e 2π i / n (e 0,e 1,e 2,,e n/2-1 ) FFT(n/2, a 0,a 2,a 4,,a n-2 ) (d 0,d 1,d 2,,d n/2-1 ) FFT(n/2, a 1,a 3,a 5,,a n-1 ) for k = 0 to n/2-1 y k e k + ω k d k y k+n/2 e k - ω k d k O(n) complex multiplies if we pre-compute ω k return (y 0,y 1,y 2,,y n-1 ) T ( n) = 2T ( n / 2) + O( n) T ( n) = O( nlogn)

Complexity Each F k is a sum of log 2 N transforms and (factors) There are N F k s So the algorithm is O(N log 2 N) This is a recursive algorithm

function y = ffttx(x) %FFTTX Textbook Fast Finite Fourier Transform % FFTTX(X) computes the same finite Fourier transform as FFT(X) % The code uses a recursive divide and conquer algorithm for % even order and matrix-vector multiplication for odd order % If length(x) is m*p where m is odd and p is a power of 2, the % computational complexity of this approach is O(m^2)*O(p*log2(p)) x = x(:); n = length(x); omega = exp(-2*pi*i/n); FFTtx if rem(n,2) == 0 % Recursive divide and conquer k = (0:n/2-1)'; w = omega ^ k; u = ffttx(x(1:2:n-1)); v = w*ffttx(x(2:2:n)); y = [u+v; u-v]; else % The Fourier matrix j = 0:n-1; k = j'; F = omega ^ (k*j); y = F*x; end

Scrambled Output of the FFT a 0, a 1, a 2, a 3, a 4, a 5, a 6, a 7 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 7 "bit-reversed" order

FFT and IFFT The FFT has revolutionized many applications by reducing the complexity by a factor of almost n Can relate many other matrices to the Fourier Matrix

Circulant Matrices Toeplitz Matrices Hankel Matrices Vandermonde Matrices

Modern signal processing very strongly based on the FFT One of the defining inventions of the 20 th century Applications: digital telephones, digital TV, MP3 players, etc