Lecture 11 Fast Fourier Transform (FFT)

Similar documents
The continuous and discrete Fourier transforms

1.4 Fast Fourier Transform (FFT) Algorithm

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

FFT Algorithms. Chapter 6. Contents 6.1

Wavelet analysis. Wavelet requirements. Example signals. Stationary signal 2 Hz + 10 Hz + 20Hz. Zero mean, oscillatory (wave) Fast decay (let)

G.A. Pavliotis. Department of Mathematics. Imperial College London

How To Understand The Discrete Fourier Transform

2 Integrating Both Sides

SGN-1158 Introduction to Signal Processing Test. Solutions

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Linear Algebra Notes for Marsden and Tromba Vector Calculus

ECE 842 Report Implementation of Elliptic Curve Cryptography

1 Review of Newton Polynomials

SOLVING LINEAR SYSTEMS

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

NOTES ON LINEAR TRANSFORMATIONS

Analysis/resynthesis with the short time Fourier transform

Final Year Project Progress Report. Frequency-Domain Adaptive Filtering. Myles Friel. Supervisor: Dr.Edward Jones

Inner Product Spaces

Factorization Theorems

Similarity and Diagonalization. Similar Matrices

3. Interpolation. Closing the Gaps of Discretization... Beyond Polynomials

TMA4213/4215 Matematikk 4M/N Vår 2013

5. Orthogonal matrices

8 Polynomials Worksheet

November 16, Interpolation, Extrapolation & Polynomial Approximation

Matrix Differentiation

FINAL EXAM SECTIONS AND OBJECTIVES FOR COLLEGE ALGEBRA

1 Introduction to Matrices

DERIVATIVES AS MATRICES; CHAIN RULE

Separable First Order Differential Equations

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Quantum Computing Lecture 7. Quantum Factoring. Anuj Dawar

Chapter 8 - Power Density Spectrum

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Inner product. Definition of inner product

Least-Squares Intersection of Lines

The sample space for a pair of die rolls is the set. The sample space for a random number between 0 and 1 is the interval [0, 1].

The Convolution Operation

Introduction to Complex Fourier Series

1 Lecture: Integration of rational functions by decomposition

GEC320 COURSE COMPACT. Four hours per week for 15 weeks (60 hours)

Representation of functions as power series

Microeconomic Theory: Basic Math Concepts

We shall turn our attention to solving linear systems of equations. Ax = b

The Characteristic Polynomial

Continued Fractions and the Euclidean Algorithm

Thnkwell s Homeschool Precalculus Course Lesson Plan: 36 weeks

Nonlinear Algebraic Equations Example

1 Determinants and the Solvability of Linear Systems

4.3 Lagrange Approximation

A note on companion matrices

Algebra 1 Course Information

Chebyshev Expansions

9 Fourier Transform Properties

1 Review of Least Squares Solutions to Overdetermined Systems

2.1 Increasing, Decreasing, and Piecewise Functions; Applications

Feb 28 Homework Solutions Math 151, Winter Chapter 6 Problems (pages )

SIGNAL PROCESSING & SIMULATION NEWSLETTER

MATH 423 Linear Algebra II Lecture 38: Generalized eigenvectors. Jordan canonical form (continued).

Fast Fourier Transform: Theory and Algorithms

Similar matrices and Jordan form

1 if 1 x 0 1 if 0 x 1

BANACH AND HILBERT SPACE REVIEW

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

1 Inner Products and Norms on Real Vector Spaces

(Refer Slide Time: 01:11-01:27)

6. Cholesky factorization

MA106 Linear Algebra lecture notes

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

3.2 Sources, Sinks, Saddles, and Spirals

9.2 Summation Notation

4.1 INTRODUCTION TO THE FAMILY OF EXPONENTIAL FUNCTIONS

Introduction to Matrix Algebra

MAC Learning Objectives. Module 10. Polar Form of Complex Numbers. There are two major topics in this module:

1 Sets and Set Notation.

Partial Fractions. Combining fractions over a common denominator is a familiar operation from algebra:

Derive 5: The Easiest... Just Got Better!

Math 55: Discrete Mathematics

5 Numerical Differentiation

1.1 Discrete-Time Fourier Transform

By choosing to view this document, you agree to all provisions of the copyright laws protecting it.

To give it a definition, an implicit function of x and y is simply any relationship that takes the form:

Linear Algebra and TI 89

Image Compression through DCT and Huffman Coding Technique

LINEAR ALGEBRA W W L CHEN

Understanding and Applying Kalman Filtering

Numerical Methods for Solving Systems of Nonlinear Equations

Nonlinear Algebraic Equations. Lectures INF2320 p. 1/88

CONTROLLABILITY. Chapter Reachable Set and Controllability. Suppose we have a linear system described by the state equation

Algebra I Notes Relations and Functions Unit 03a

Solution of Linear Systems

1. First-order Ordinary Differential Equations

6 Systems Represented by Differential and Difference Equations

Introduction to Matrices for Engineers

Chapter 7 - Roots, Radicals, and Complex Numbers

Transcription:

Lecture 11 Fast Fourier Transform (FFT) Weinan E 1,2 and Tiejun Li 2 1 Department of Mathematics, Princeton University, weinan@princeton.edu 2 School of Mathematical Sciences, Peking University, tieli@pku.edu.cn No.1 Science Building, 1575

Outline Examples Fast Fourier Transform Applications

Signal processing Filtering: a polluted signal 1.5 1 0.5 0 0.5 1 1.5 0 200 400 600 800 1000 1200 High pass and low pass filter (signal and noise) 1.5 1 0.5 0 0.5 1 1.5 0 200 400 600 800 1000 1200 How to obtain the high frequency and low frequency quickly?

Solving PDEs on rectangular mesh Solving the Poisson equations u = f in Ω u = 0 on Ω in the rectangular domain After discretization we will obtain the linear system with about N 2 unknowns ui+1,j + ui 1,j + ui,j+1 + ui,j 1 4ui,j 4h 2 = f ij The FFT would give a fast algorithm to solve the system above with computational efforts O(N 2 log 2 N).

Computing convolution ( ) Suppose h(x) = 2π 0 f(x y)g(y)dy is the convolution of f and g, where f(x), g(x) C 2π are period 2π functions. Take x j = jδ, j = 0, 1,..., N 1, δ = 2π N discretization h(x i) N 1 j=0 and apply simple rectangular f(x i x j)g(x j) δ i = 0, 1,..., N 1 Define f i = f(x i), g i = g(x i), and let f i is period N respect to the subscript i, define h i = N 1 j=0 The direct computation is O(N 2 ). f i jg j δ i = 0, 1,..., N 1

Fast Fourier Transform Fast Fourier Transform is one of the top 10 algorithms in 20th century. But its idea is quite simple, even for a high school student!

Outline Examples Fast Fourier Transform Applications

Fourier Transform Suppose f(x) is absolutely integrable in (, + ), then the Fourier transform of f(x) is ˆf(k) = + f(x)e ikx dx. Moreover if f(x) is square integrable, then the inverse Fourier transform of ˆf(k) is f(x) = 1 + ˆf(k)e ikx dk. 2π

Properties of Fourier transform Some important properties of Fourier transform: 1. Derivative to coefficient: 2. Translation property: 3. Convolution to multiplication: (f (x))(k) = ik ˆf(k); (f(x a))(k) = e ika ˆf(k); (f g)(k) = ˆf(k)ĝ(k); where (f g)(x) = + f(x y)g(y)dy. 4. Parseval s identity: + f(x) 2 dx = 1 2π + ˆf(k) 2 dk.

Discrete Fourier transform (DFT) Suppose we have a = (a 0, a 1,, a N 1) T, define DFT of a as c = (c 0, c 1,, c N 1) T = â, where c k = N 1 j=0 jk 2πi a je N, k = 0, 1,..., N 1. Here i is the imaginary unit, e 2πi N = ω is the N-th root of unity. a is the inverse discrete Fourier transform of c defined as a j = 1 N N 1 k=0 jk 2πi c k e N, j = 0, 1,..., N 1. DFT is closely related to the trigonometric interpolation for 2π-periodic function T (x) = N 2 k= N 2 +1 b k e ikx. such that at x j = 2jπ, T (xj) = aj, j = 0, 1,..., N 1. The readers N may find the relation between c k and b k.

Remark on DFT DFT can be considered as a linear transformation. Define Fourier matrix 1 1 1 F = 1 ω ω N 1 = (ωjk ) N 1 1 ω N 1 ω (N 1)2 j,k=0 where ω is the N-th root of unity. c is the Fourier transform of a can be represented as c = F a

Remark on DFT Inverse DFT can also be considered as a linear transformation. Define inverse Fourier matrix 1 1 1 F 1 = G = 1 1 ω 1 ω (N 1) N = (ω jk ) N 1 1 ω (N 1) ω (N 1)2 j,k=0 where ω is the N-th root of unity. a is the inverse Fourier transform of c can be represented as a = Gc

Properties of DFT Convolution to multiplication: where (f g) k = ˆf k ĝ k k = 0, 1,..., N 1 (f g) l = N 1 j=0 f l j g j l = 0, 1,..., N 1, and f l is period N with respect to index l, i.e. f 1 = f N 1, f 2 = f N 2,... Parseval s identity: N N 1 j=0 a j 2 = N 1 k=0 c k 2

FFT idea FFT is proposed by J.W. Cooley and J.W. Tukey in 1960s, but the idea may be traced back to Gauss. The basic motivation is if we compute DFT directly, i.e. c = F a we need N 2 multiplications and N(N 1) additions. Is it possible to reduce the computation effort? First consider the case N = 4 1 1 1 1 (a 0 + a 2) + (a 1 + a 3) F = 1 i 1 i 1 1 1 1, F a = (a 0 a 2) i(a 1 a 3) (a 0 + a 2) (a 1 + a 3) 1 i 1 i (a 0 a 2) + i(a 1 a 3)

FFT idea From the concrete form of DFT, we actually need 2 multiplications (timing ±i) and 8 additions (a 0 + a 2, a 1 + a 3, a 0 a 2, a 1 a 3 and the additions in the middle). This observation may reduce the computational effort from O(N 2 ) into O(N log 2 N) Because It is a typical fast algorithm. log lim 2 N N N = 0 Fast algorithms of this type of recursive halving are very typical in scientific computing.

Construction of FFT Consider N = 2 m and denote p(x) = a 0 + a 1x + + a N 1x N 1, divide p(x) into odd ( ) and even ( ) power parts p(x) = (a 0 + a 2x 2 + ) + x(a 1 + a 3x 2 + ) = p e(x 2 ) + xp o(x 2 ) where p e(t) = a 0 + a 2t +... + a N 2t N 2 1, p o(t) = a 1 + a 3t +... + a N 1t N 2 1 Define ω k = e 2πi k (k-th root of unity), then when j = 0, 1,..., N 2 1 c j c N 2 +j = p e(ω 2j N ) + ωj N po(ω2j N ) = p e(ω 2( N 2 +j) N ) + ω N 2 +j N p o(ω 2( N 2 +j) N )

Construction of FFT Pay attention that ω 2j N = ωj N 2, ω N 2 +j N = ω j N, ωn+2j N = ω j N 2 then c j = v j + ω j N uj, c j+ N 2 = v j ω j N uj j = 0, 1,..., N 2 1 where v j = p e(ω j N 2 ), u j = p o(ω j N 2 ) The formula above show that the DFT of N components vector a could be converted to compute the DFT of two N components vectors ae, ao 2 and some simple additions and multiplications. This is called Danielson-Lanczos algorithm. The recursive application of this idea gives FFT.

A simple example: N = 8 Suppose the array a = (a 0, a 1,, a 7) T Step A: Splitting (reordering) (odd parts and even parts): Step 1 Step 2 Step 3 a e = (a 0, a 2, a 4, a 6 ) T, a o = (a 1, a 3, a 5, a 7 ) T ; a ee = (a 0, a 4 ) T, a eo = (a 2, a 6 ) T, a oe = (a 1, a 5 ) T, a oo = (a 3, a 7 ) T ; a eee a eeo a eoe a eoo a oee a oeo a ooe a ooo a 0 a 4 a 2 a 6 a 1 a 5 a 3 a 7

A simple example: N = 8 Step B: Combination: Step 1 c ee = (a 0 + ω2a 0 4, a 0 ω2a 0 4) T, c eo = (a 2 + ω2a 0 6, a 2 ω2a 0 6) T, c oe = (a 1 + ω2a 0 5, a 1 ω2a 0 5) T, c oo = (a 3 + ω2a 0 7, a 3 ω2a 0 7) T, Define the notations w 4 (w 0 4, w 1 4) T, w 8 (w 0 8, w 1 8, w 2 8, w 3 8) T, and X Y (x jy j) j as the vector product through multiplication by components.

A simple example: N = 8 Step B: Combination: Step 2 Step 3 [ ] [ ] cee + w 4 c eo coe + w 4 c oo c e =, c o =, c ee w 4 c eo c oe w 4 c oo [ ] ce + w 8 c 0 c = c e w 8 c 0

A simple sketch of FFT (N = 8) a reordering a 0 a 4 a 2 a 6 a 1 a 5 a 3 a 7 combination 1 c ee c eo c eo c oo combination 2 [ ce c o ] combination 3 c

A remark on the reordering If we map e to 0, and o to 1 we can find the binary representation of the indices after reordering is just the bit reversal before reordering 0= 000 2 1= 001 2 2= 010 2 3 = 011 2 4 = 100 2 5 = 101 2 6 = 110 2 7 = 111 2 Bit reversal 000 2 = 0 100 2 = 4 010 2 = 2 110 2 = 6 001 2 = 1 101 2= 5 011 2= 3 111 2= 7

Outline Examples Fast Fourier Transform Applications

Compute the convolution From the discretization at the beginning, we have h i = N 1 j=0 f i jg j δ i = 0, 1,..., N 1 thus h = (ĥ) = (δ ˆf ĝ) After using FFT, N 2 + N multiplications and N(N 1) additions are reduced to 3 2 N log 2 N + 2N multiplications and 3N log 2 N additions.

Solving the linear system with loop matrix Let L = c 0 c N 1 c 1 c 1 c 0 c 2 Solving Lx = b. L is a loop matrix. We have c N 1 c N 2 c 0 (Lx) i = N 1 j=0 c i jx j where we assume c is period N with respect to the subscripts, and x = (x 0, x 1,..., x N 1) T.

Solving the linear system with loop matrix First consider the Jordan form of L. From the formula before Lx = c x = λx Take DFT we have then eigenvalues ĉ ˆx = λˆx The eigenvectors where δ kj is Kronecker s δ. Take inverse transform we obtain λ k = ĉ k ˆx (k) j = δ kj, (j, k = 0, 1,..., N 1) x (0) = (1, 1,..., 1) T, x (1) = (1, ω 1,..., ω (N 1) ) T,......... x (N 1) = (1, ω (N 1),..., ω (N 1)2 ) T

Solving the linear system with loop matrix Spectral decomposition of L L = (x (0) x (1) x (N 1) ) λ 0 λ 1... (x (0) x (1) x (N 1) ) 1 = (NF 1 )Λ (NF 1 ) 1 = F 1 ΛF λ N 1 Solving Lx = b is equivalent to F 1 ΛF x = b, i.e. Λ(F x) = F b. Then it is composed of three steps: Step 1: Compute F b i.e. apply FFT to b to obtain ˆb; Step 2: Compute Λ i.e. apply FFT to c to obtain ĉ; Step 3: Compute ˆx k = ˆb k /ĉ k, and then compute (ˆx) to obtainx.

Homework assignment Familiarize the FFT and IFFT command in MATLAB; Compute the convolution for h(x) = 2π 0 sin(x y)e cos y dy