FFT(Fast Fourier Transform)

20
FFT(Fast Fourier Transform)

description

FFT(Fast Fourier Transform). FFT. Coefficient representation:. How to evaluate A(x 0 )?. Horner’s rule: Point-value representation:. Thm1. Pf:. n-point interpolation: Lagrange’s formula:. Cof. rep. Point-value rep. Thm2. Lemma 3 (Cancellation Lemma) - PowerPoint PPT Presentation

Transcript of FFT(Fast Fourier Transform)

Page 1: FFT(Fast Fourier Transform)

FFT(Fast Fourier Transform)

Page 2: FFT(Fast Fourier Transform)

p2.

FFT1

0 1 1

10 1 1

2 2 3 2 20 1 2 2 3 2 2

0

( ) .....

( ) .....

( ) ( ) ( )

= c .....

nn

nn

n nn n

j

j k j kk

A x a a x a x

B x b b x b x

C x A x B x

c x c x c x c x

c a b

•Coefficient representation: How to evaluate A(x0)?

Page 3: FFT(Fast Fourier Transform)

p3.

Horner’s rule:

Point-value representation:

0 0 0 1 0 2 0 2 0 1( ) ( ( ..... ( )...))

(n)n nA x a x a x a x a x a

0 0

1 1 n-1 1 k

A point-value representation of a polynomial A(x) of

degree-bound n is a set of n point-value pairs {(x , ),

(x , ),.....(x , )}, where y ( )n k

y

y y A x

0 0 1 1 2n-1 2 1

' ' '0 0 1 1 2n-1 2 1

' ' '0 0 0 1 1 1 2n-1 2 1 2 1

:{(x , ), (x , ),.....(x , )}

:{(x , ), (x , ),.....(x , )}

:{(x , ), (x , ),.....(x , )}

n

n

n n

A y y y

B y y y

C y y y y y y

Page 4: FFT(Fast Fourier Transform)

p4.

Thm1

0 0 1 1 n-1 1

k

For any set {(x , ), (x , ),.....(x , )} of n point-value

pairs, there is a unique poly A(x) of degree n-1, such that

y ( ) for k=0, 1,...., n-1

n

k

y y y

A x

Pf:2 1

0 0 0

2 11 1 1

2 11 1 1

0 0

1 1

1 1

1

1 if X = then

1

y

y

n

n

nn n n

n n

x x x

x x x

x x x

a

aX

a y

Page 5: FFT(Fast Fourier Transform)

p5.

n-point interpolation:Lagrange’s formula:

0 0

1 11

1 1

det( ) ( ) 0 if 's are distinct

Thus, 's can be solved uniquely.

y

y

k jk

n

kj

j

n

a

aX

X x x x

a

a y

1

0

( )

( )( )

jnj k

kk k j

j k

x x

A x yx x

Page 6: FFT(Fast Fourier Transform)

p6.

0 1 1

0 1 1

, ,....,

, ,....,n

n

a a a

b b b

0 02 2

0 02 2

2 1 2 12 2

( ), ( )

( ), ( )

,

( ), ( )

n n

n n

n nn n

A B

A B

A B

02

02

2 12

( )

( )

( )

n

n

nn

C

C

C

0 1 2 2, ,...., nc c c

Evalation

( log )n n

2

Ordinary Mult

( )n

Pointwise Mult

( )n

Interpolation

( log )n n

Point-valuerep.

Cof.rep.

Page 7: FFT(Fast Fourier Transform)

p7.

Thm2The product of 2 polynomials of deg-bound n can

be computed in time (nlog n), with both the input

and output representation in coefficient form

0

( )mod

n 2 ik/n iu

2 i/n

0 1 2 1

Complex roots of unity:

1, e for k=0, 1, ..., n-1 e cos sin

e , the principal n-th root of unity

, , ,..

=?, =

.,

1

=

n

n

nn n

j k j k nn n

n

n

n n

n

n

u i u

1 1nn

Page 8: FFT(Fast Fourier Transform)

p8.

Lemma 3 (Cancellation Lemma)n, k, d: non-negative integers,

Cor. 4 n: even positive integer

dk kdn n

Pf:

2 / 2 /( ) ( )dk i dn dk i n k kdn ne e

/ 22 1n

n

Page 9: FFT(Fast Fourier Transform)

p9.

Lemma 5 (Halving lemma)n: even positive integer

The squares of the n complex n-th roots of unity are n/2

complex (n/2)th roots of unity.

2 2/ 2,

/ 2 2 2 2/ 2

/ 2

( ) where {0}

( )

and have the same squre

k k kn n n

k n k n k kn n n n

k k nn n

k Z

Pf:

Lemma 6 (Summation lemma)n-1

kn

j=0

, {0}, | , ( ) 0jn Z k Z n k Pf:

k nn-1k n nn k k

j=0 n n

( ) 1 ( ) 1( ) 0

1 1

n kj

Page 10: FFT(Fast Fourier Transform)

p10.

DFT-1

0 1 -1

0

-1

0 1 -10

0 1 -1

0 1 n-1

Evaluate ( ) , ,....., ,

Assume n is a power of 2

Let , ,...., , and ( )

, ,...., is the DFT of the coefficient

vector a=<a ,a ,...., a

nj n

j n n nj

nk kj

n k n j nj

n

A x a x at

a a a a y A a

y y y y

,

DFT ( )ny a

Page 11: FFT(Fast Fourier Transform)

p11.

Interpolation at the complex roots of unity:

02 1

1

2 4 2( 1)2

1 2( 1)1

1 1 1 1 y

1 y

y = 1

1

nn n n

nn n n

n nn n n ny

0

1

2

( 1)( 1)1

,

1

, ( )

n nn

kjn n k j n

n

a

a

a

a

y V a V

a V y

Page 12: FFT(Fast Fourier Transform)

p12.

Thm 7 1

,, 0,1,....., 1, ( ) /kjn j k nj k n V n

11 1 1

, ' , , '0

1'

0

1( ' )

0

, ( ) ( ) ( )

1 =

1 = -------(*)

if j=j', then (*)=1, if j

n

n n n n n j j n j k n k jk

nkj kjn n

k

nk j jn

k

V V I V V V V

n

n

1 1

0 0

j', then by lemma 6, (*)=0

-(n-1) < j'-j <n-1, and n

1,

|

(j'-j

)n n

k j k jj k n k j n

k j

a y y an

Pf:

Page 13: FFT(Fast Fourier Transform)

p13.

FFT[0] 2 / 2 1

0 2 4 2

[1] 2 / 2 11 3 5 1

[0] [12 2]

( ) .....

( ) .....

(*) ( ) ( ) ( )

nn

nn

A x a a x a x a x

A x a a x a x a x

A x x A xA x

[0] [1]

0 2

0 1

1 2 1 2

1

1. evaluating ( ) and ( ) at

Thus ev

( ) , ( ) ,....., (

aluating A(x) at , ,....., reduce

)

2. combining the results according to (*)

to

nn n n

nn n n

A x A x

Page 14: FFT(Fast Fourier Transform)

p14.

[0] [0]/ 2

[1] [1]/ 2

[0] 2 [1] 2

[0] [1

/ 2 [0] 2 / 2 [1]/

]/ 2 / 2

[

2

[0] 1]

( )

( )

( ) ( ) ( )

= ( ) ( )

Le

( )

=

t

) (

(

kk n

kk n

k k k kk n n n n

k k

k n k n k nk

kn n

n n n

n

k

n

kk n

y A A

y A

y A

y A A A

A

A

A

y y

[

2

[0] / 2 [1]/ 2 / 2

[0] / 2 [ 0] [1] ]1

)

= ( ) ( )

=

k nn

k k n kn n n

k nk k

kk n kn y

A

y

A

y y

Page 15: FFT(Fast Fourier Transform)

2 /n

[0]0 2 2

[1]1 3 1

[0] [0]

[1]

Recursive-FFT(a)

{ n=length[a]; /* n: power of 2 */

if n=1 the return a;

;

=1

a ( , ,....., );

a ( , ,....., );

y Recursive-FFT(a );

y Recurs

i n

n

n

e

a a a

a a a

[1]

[0] [1]k k k

[0] [1]k+n/2 k k

n

ive-FFT(a );

for k=0 to (n/2 - 1) do

{

y y y ;

y y y ;

= ; }

}

( ) 2 ( / 2) ( )

= (nlog n)

T n T n n

Page 16: FFT(Fast Fourier Transform)

p16.

Thm 8 (Convolution thm)

-12 2 2

: power of 2

, : vectors of length

=DFT (DFT ( ) DFT ( ))n n n

n

a b n

a b a b

0 0 0 1 1 0 0 2 1 1 2 0

k=0

, , ,......

j-th elt: j

k j k

a b a b a b a b a b a b a b

a b

Componentwise product

Page 17: FFT(Fast Fourier Transform)

Efficient FFT implement[0]ky

[1]ky

kn

[0] [1]kk n ky y

[0] [1]kk n ky y

0 1 2 3 4 5 6 7( , , , , , , , )a a a a a a a a

0 2 4 6( , , , )a a a a 1 3 5 7( , , , )a a a a

2 6( , )a a1 5( , )a a 3 7( , )a a0 4( , )a a

3

011

a 7

111

a5

101

a1

001

a6

110

a2

010

a4

100

a0

000

a

s

s-1

s-1 s-1 s-1

:

for s=1 to (lg n) do

for k=0 to n-1 by 2

combine the two 2 element DFT's in

A[k..k+2 1] and A[k+2 ..k+2 1]

i

Idea

s snto one 2 element DFT in A[k..k+2 1]

[0]y

[1]y

Page 18: FFT(Fast Fourier Transform)

s

2 /m

FFT-Base(a)

{ n = length[a];

for s=1 to (lg n) do

{ m=2 ;

;

for k=0 to n-1 by do

{ =1;

for j=0 to (m/2 - 1) do

{ t= [ / 2];

m

i me

A k j m

u=A[k+j];

A[k+j]=u+t;

A[k+j+m/2]=u-t;

; }

} } }m

Page 19: FFT(Fast Fourier Transform)

p19.

s 2 /

Iterative-FFT(a)

{ Bit-Reverse-Copy(a, A);

n=length[a];

for s=1 to (lg n) do

{ m=2 ; ; 1;

for j=0 to (m/2 -1) do

{ for k=j to n-1 by m do

i mm e

{ t = [ / 2];

u = A[k];

A[k]=u+t;

A[k+m/2]=u-t; }

}

}

}

m

A k m

k

Bit-Reverse-Copy(a,A)

{ n=length[a];

for k=0 to n-1 do

eg

rev(011

A[rev(k

)=110, rev(00

)] = a

}

1)=100

Page 20: FFT(Fast Fourier Transform)

0a

1a

2a

4a

3a

5a

6a

7a

02

02

02

02

04

14

04

14

08

18

38

28

0y

1y

2y

4y

3y

5y

6y

7y

FFT circuit

8

In general, depth: (lg n)

size : (nlg n)

n

S=1 S=2 S=3