Sparse Fourier Transform (lecture 2) - People | MIT...

154
Sparse Fourier Transform (lecture 2) Michael Kapralov 1 1 IBM Watson MADALGO’15 1 / 75

Transcript of Sparse Fourier Transform (lecture 2) - People | MIT...

Page 1: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Sparse Fourier Transform(lecture 2)

Michael Kapralov1

1IBM Watson

MADALGO’15

1 / 75

Page 2: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Given x ∈Cn, compute the Discrete Fourier Transform of x :

xf =1n

∑j∈[n]

xjω−f ·j ,

where ω= e2πi/n is the n-th root of unity.

Goal: find the top k coefficients of x approximately

In last lecture:

Ï 1-sparse noiseless case: two-point sampling

Ï 1-sparse noisy case: O(logn loglogn) time and samples

Ï reduction from k -sparse to 1-sparse case, via filtering

2 / 75

Page 3: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Given x ∈Cn, compute the Discrete Fourier Transform of x :

xf =1n

∑j∈[n]

xjω−f ·j ,

where ω= e2πi/n is the n-th root of unity.

Goal: find the top k coefficients of x approximately

In last lecture:

Ï 1-sparse noiseless case: two-point sampling

Ï 1-sparse noisy case: O(logn loglogn) time and samples

Ï reduction from k -sparse to 1-sparse case, via filtering

2 / 75

Page 4: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Given x ∈Cn, compute the Discrete Fourier Transform of x :

xf =1n

∑j∈[n]

xjω−f ·j ,

where ω= e2πi/n is the n-th root of unity.

Goal: find the top k coefficients of x approximately

In last lecture:

Ï 1-sparse noiseless case: two-point sampling

Ï 1-sparse noisy case: O(logn loglogn) time and samples

Ï reduction from k -sparse to 1-sparse case, via filtering

2 / 75

Page 5: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Given x ∈Cn, compute the Discrete Fourier Transform of x :

xf =1n

∑j∈[n]

xjω−f ·j ,

where ω= e2πi/n is the n-th root of unity.

Goal: find the top k coefficients of x approximately

In last lecture:

Ï 1-sparse noiseless case: two-point sampling

Ï 1-sparse noisy case: O(logn loglogn) time and samples

Ï reduction from k -sparse to 1-sparse case, via filtering

2 / 75

Page 6: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.001

-0.0005

0

0.0005

0.001

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

3 / 75

Page 7: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.001

-0.0005

0

0.0005

0.001

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

4 / 75

Page 8: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.001

-0.0005

0

0.0005

0.001

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

4 / 75

Page 9: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

5 / 75

Page 10: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

6 / 75

Page 11: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

6 / 75

Page 12: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

6 / 75

Page 13: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

6 / 75

Page 14: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

6 / 75

Page 15: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into B ≈ k buckets

-0.0008

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

0.0008

-1000 -500 0 500 1000

time

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

For each j = 0, . . . ,B−1 let

ujf =

xf , if f ∈ j-th bucket0 o.w.

Restricted to a bucket, signal is likely approximately 1-sparse!

6 / 75

Page 16: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

We want time domain access to u0: for any a= 0, . . . ,n−1,compute

u0a = ∑

− n2B ≤f≤ n

2B

xf ·ωf ·a.

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Thenu0

a = (x·+a ∗ G)(0)

For any j = 0, . . . ,B−1

uja = (x·+a ∗ G)(j · n

B)

7 / 75

Page 17: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

We want time domain access to u0: for any a= 0, . . . ,n−1,compute

u0a = ∑

− n2B ≤f≤ n

2B

xf ·ωf ·a.

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Thenu0

a = (x·+a ∗ G)(0)

For any j = 0, . . . ,B−1

uja = (x·+a ∗ G)(j · n

B)

7 / 75

Page 18: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Reducing k -sparse recovery to 1-sparse recovery

For any j = 0, . . . ,B−1

uja = (x·+a ∗ G)(j · n

B)

−1000 −800 −600 −400 −200 0 200 400 600 800 1000−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

time

magnitu

de

−1000 −800 −600 −400 −200 0 200 400 600 800 1000−0.2

0

0.2

0.4

0.6

0.8

1

frequency

magnitu

de

8 / 75

Page 19: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Reducing k -sparse recovery to 1-sparse recovery

For any j = 0, . . . ,B−1

uja = (x·+a ∗ G)(j · n

B)

−1000 −800 −600 −400 −200 0 200 400 600 800 1000−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

time

magnitu

de

−1000 −800 −600 −400 −200 0 200 400 600 800 1000−0.2

0

0.2

0.4

0.6

0.8

1

frequency

magnitu

de

9 / 75

Page 20: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Reducing k -sparse recovery to 1-sparse recovery

For any j = 0, . . . ,B−1

uja = (x·+a ∗ G)(j · n

B)

−1000 −800 −600 −400 −200 0 200 400 600 800 1000−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

time

magnitu

de

−1000 −800 −600 −400 −200 0 200 400 600 800 1000−0.2

0

0.2

0.4

0.6

0.8

1

frequency

magnitu

de

10 / 75

Page 21: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Need to evaluate(x·+a ∗ G)

(j · n

B

)for j = 0, . . . ,B−1.

We have access to x , not x ...

By the convolution identity

x·+a ∗ G = á(x·+a ·G)

Suffices to compute

àx·+a ·Gj · nB

, j = 0, . . . ,B−1

11 / 75

Page 22: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Need to evaluate(x·+a ∗ G)

(j · n

B

)for j = 0, . . . ,B−1.

We have access to x , not x ...

By the convolution identity

x·+a ∗ G = á(x·+a ·G)

Suffices to compute

àx·+a ·Gj · nB

, j = 0, . . . ,B−1

11 / 75

Page 23: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Need to evaluate(x·+a ∗ G)

(j · n

B

)for j = 0, . . . ,B−1.

We have access to x , not x ...

By the convolution identity

x·+a ∗ G = á(x·+a ·G)

Suffices to compute

àx·+a ·Gj · nB

, j = 0, . . . ,B−1

11 / 75

Page 24: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Suffices to compute

àx·+a ·Gj · nB

, j = 0, . . . ,B−1

Sample complexity? Runtime?

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Computing x ·G takes Ω(N) time and samples!

11 / 75

Page 25: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Suffices to compute

x ·Gj · nB

, j = 0, . . . ,B−1

Sample complexity? Runtime?

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Computing x ·G takes Ω(N) time and samples!

11 / 75

Page 26: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Suffices to compute

x ·Gj · nB

, j = 0, . . . ,B−1

Sample complexity? Runtime?

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Computing x ·G takes Ω(N) time and samples!

11 / 75

Page 27: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Suffices to compute

x ·Gj · nB

, j = 0, . . . ,B−1

Sample complexity? Runtime?

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Computing x ·G takes Ω(N) time and samples!

11 / 75

Page 28: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

To sample all signals uj , j = 0, . . . ,B−1 in time domain, it sufficesto compute x ·Gj · n

B, j = 0, . . . ,B−1

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Computing x ·G takes supp(G) samples.

Design G with supp(G)≈ k that approximates rectangular filter?

11 / 75

Page 29: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

In this lecture:

Ï permuting frequencies

Ï filter construction

Ï recovery algorithm (k -sparse noiseless case)

12 / 75

Page 30: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

1. Pseudorandom spectrum permutations

2. Filter construction

3. Basic block: partial recovery

4. Full algorithm

13 / 75

Page 31: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

1. Pseudorandom spectrum permutations

2. Filter construction

3. Basic block: partial recovery

4. Full algorithm

14 / 75

Page 32: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Pseudorandom spectrum permutationsPermutation in time domain plus phase shift =⇒ permutation infrequency domain

ClaimLet σ,b ∈ [n], σ invertible modulo n. Let yj = xσjω

−jb. Then

yf = xσ−1(f+b).

(proof on next slide; a close relative of time shift theorem)

Pseudorandom permutation:

Ï select b uniformly at random from [n]

Ï select σ uniformly at random from 1,3,5, . . . ,n−1(invertible numbers modulo n)

15 / 75

Page 33: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Pseudorandom spectrum permutationsPermutation in time domain plus phase shift =⇒ permutation infrequency domain

ClaimLet σ,b ∈ [n], σ invertible modulo n. Let yj = xσjω

−jb. Then

yf = xσ−1(f+b).

(proof on next slide; a close relative of time shift theorem)

Pseudorandom permutation:

Ï select b uniformly at random from [n]

Ï select σ uniformly at random from 1,3,5, . . . ,n−1(invertible numbers modulo n)

15 / 75

Page 34: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Pseudorandom spectrum permutationsPermutation in time domain plus phase shift =⇒ permutation infrequency domain

ClaimLet σ,b ∈ [n], σ invertible modulo n. Let yj = xσjω

−jb. Then

yf = xσ−1(f+b).

(proof on next slide; a close relative of time shift theorem)

Pseudorandom permutation:

Ï select b uniformly at random from [n]

Ï select σ uniformly at random from 1,3,5, . . . ,n−1(invertible numbers modulo n)

15 / 75

Page 35: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Pseudorandom spectrum permutationsClaimLet yj = xσjω

−jb. Then yf = xσ−1(f+b).

Proof.

yf =1n

∑j∈[n]

yjω−f ·j

= 1n

∑j∈[n]

xσjω−(f+b)·j

= 1n

∑i∈[n]

xiω−(f+b)·σ−1i (change of variables i =σj)

= 1n

∑i∈[n]

xiω−σ−1(f+b)·i

= xσ−1(f+b)

16 / 75

Page 36: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Design G with supp(G)≈ k that approximates rectangular filter?

Our filter G will approximate the boxcar. Bound collisionprobability now.

16 / 75

Page 37: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into buckets, permute spectrum

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

Frequency i collides with frequency j only if |σi −σj | ≤ nB .

17 / 75

Page 38: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into buckets, permute spectrum

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

Frequency i collides with frequency j only if |σi −σj | ≤ nB .

18 / 75

Page 39: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into buckets, permute spectrum

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

Frequency i collides with frequency j only if |σi −σj | ≤ nB .

19 / 75

Page 40: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Partition frequency domain into buckets, permute spectrum

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

collision

Frequency i collides with frequency j only if |σi −σj | ≤ nB .

20 / 75

Page 41: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Collision probabilityLemmaLet σ be a uniformly random odd number in 1,2, . . . ,n. Then forany i , j ∈ [n], i 6= j one has

Prσ[|σ · i −σj | ≤ n

B

]=O(1/B)

Proof.Let ∆ := i − j = d2s for some odd d .

The orbit of σ ·∆ is 2s ·d ′ for all odd d ′.

[ ]σi − n

Bσi σi + n

B

There are O( n

B2s

)values of d ′ that make σ ·∆ fall into

[− nB , n

B],

out of n/2s+1.

21 / 75

Page 42: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Collision probabilityLemmaLet σ be a uniformly random odd number in 1,2, . . . ,n. Then forany i , j ∈ [n], i 6= j one has

Prσ[|σ · i −σj | ≤ n

B

]=O(1/B)

Proof.Let ∆ := i − j = d2s for some odd d .

The orbit of σ ·∆ is 2s ·d ′ for all odd d ′.

[ ]σi − n

Bσi σi + n

B

There are O( n

B2s

)values of d ′ that make σ ·∆ fall into

[− nB , n

B],

out of n/2s+1.21 / 75

Page 43: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Collision probabilityLemmaLet σ be a uniformly random odd number in 1,2, . . . ,n. Then forany i , j ∈ [n], i 6= j one has

Prσ[|σ · i −σj | ≤ n

B

]=O(1/B)

Proof.Let ∆ := i − j = d2s for some odd d .

The orbit of σ ·∆ is 2s ·d ′ for all odd d ′.

[ ]σi − n

Bσi σi + n

B

There are O( n

B2s

)values of d ′ that make σ ·∆ fall into

[− nB , n

B],

out of n/2s+1.21 / 75

Page 44: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Collision probabilityLemmaLet σ be a uniformly random odd number in 1,2, . . . ,n. Then forany i , j ∈ [n], i 6= j one has

Prσ[|σ · i −σj | ≤ n

B

]=O(1/B)

Proof.Let ∆ := i − j = d2s for some odd d .

The orbit of σ ·∆ is 2s ·d ′ for all odd d ′.

[ ]σi − n

Bσi σi + n

B

There are O( n

B2s

)values of d ′ that make σ ·∆ fall into

[− nB , n

B],

out of n/2s+1.21 / 75

Page 45: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Collision probabilityLemmaLet σ be a uniformly random odd number in 1,2, . . . ,n. Then forany i , j ∈ [n], i 6= j one has

Prσ[|σ · i −σj | ≤ n

B

]=O(1/B)

Proof.Let ∆ := i − j = d2s for some odd d .

The orbit of σ ·∆ is 2s ·d ′ for all odd d ′.

[ ]σi − n

Bσi σi + n

B

There are O( n

B2s

)values of d ′ that make σ ·∆ fall into

[− nB , n

B],

out of n/2s+1.21 / 75

Page 46: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

1. Pseudorandom spectrum permutations

2. Filter construction

3. Basic block: partial recovery

4. Full algorithm

22 / 75

Page 47: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Rectangular buckets G have full support in time domain...

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

frequency

Approximate rectangular filter with a filter G with small support?

Need supp(G)≈ k , so perhaps turn the filter around?

23 / 75

Page 48: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Have supp(G)=B ≈ k , but buckets leak

24 / 75

Page 49: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

=⇒

In what follows: reduce leakage at the expense of increasingsupp(G)

25 / 75

Page 50: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functionsDefinitionA symmetric filter G is a (B,δ)-standard window function if

1. G0 = 12. Gf ≥ 03. |Gf | ≤ δ for f 6∈ [− n

2B , n2B

]

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

26 / 75

Page 51: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functions

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

Start with the sinc function:

Gf :=sin(π(B+1)f/n)(B+1) ·πf/n

For all |f | > n2B we have

|Gf | ≤1

(B+1)πf/n≤ 1π/2

≤ 2/π≤ 0.9

27 / 75

Page 52: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functions

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

Start with the sinc function:

Gf :=sin(π(B+1)f/n)(B+1) ·πf/n

For all |f | > n2B we have

|Gf | ≤1

(B+1)πf/n≤ 1π/2

≤ 2/π≤ 0.9

27 / 75

Page 53: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functions

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

Consider powers of the sinc function:

Grf :=

(sin(π(B+1)f/n)(B+1) ·πf/n

)r

For all |f | > n2B we have

|Gf |r ≤ (0.9)r

28 / 75

Page 54: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functions

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

Consider powers of the sinc function:

Grf :=

(sin(π(B+1)f/n)(B+1) ·πf/n

)r

For all |f | > n2B we have

|Gf |r ≤ (0.9)r

29 / 75

Page 55: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functions

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

Consider powers of the sinc function: Grf

For all |f | > n2B we have

|Gf |r ≤ (0.9)r

So setting r =O(log(1/δ)) is sufficient!

30 / 75

Page 56: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functions

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

Consider powers of the sinc function: Grf

For all |f | > n2B we have

|Gf |r ≤ (0.9)r

So setting r =O(log(1/δ)) is sufficient!31 / 75

Page 57: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functionsDefinitionA symmetric filter G is a (B,δ)-standard window function if

1. G0 = 12. Gf ≥ 03. |Gf | ≤ δ for f 6∈ [− n

2B , n2B

]

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

32 / 75

Page 58: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Window functionsDefinitionA symmetric filter G is a (B,δ)-standard window function if

1. G0 = 12. Gf ≥ 03. |Gf | ≤ δ for f 6∈ [− n

2B , n2B

]

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

How large is supp(G)⊆ [−T ,T ]? 33 / 75

Page 59: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

33 / 75

Page 60: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

32 / 75

Page 61: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 62: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 63: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 64: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 65: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 66: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 67: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Let

Gj :=

1/(B+1) if j ∈ [−B/2,B/2]0 o.w.

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

0

0.2

0.4

0.6

0.8

1

1.2

-1000 -500 0 500 1000

time

Let Gr := (G0)r . How large is the support of Gr ?

By the convolution identity Gr =G0 ∗G0 ∗ . . .∗G0

Support of G0 is in [−B/2,B/2], so

supp(G∗ . . .∗G)⊆ [−r ·B/2,r ·B/2]

31 / 75

Page 68: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window functionDefinitionA symmetric filter G is a (B,δ,γ)-flat window function if

1. Gj ≥ 1−δ for all j ∈ [−(1−γ) n2B ,(1−γ) n

2B]

2. Gj ∈ [0,1] for all j

3. |Gf | ≤ δ for f 6∈ [− n2B , n

2B]

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

32 / 75

Page 69: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window functionDefinitionA symmetric filter G is a (B,δ,γ)-flat window function if

1. Gj ≥ 1−δ for all j ∈ [−(1−γ) n2B ,(1−γ) n

2B]

2. Gj ∈ [0,1] for all j

3. |Gf | ≤ δ for f 6∈ [− n2B , n

2B]

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

33 / 75

Page 70: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window functionDefinitionA symmetric filter G is a (B,δ,γ)-flat window function if

1. Gj ≥ 1−δ for all j ∈ [−(1−γ) n2B ,(1−γ) n

2B]

2. Gj ∈ [0,1] for all j

3. |Gf | ≤ δ for f 6∈ [− n2B , n

2B]

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

0.99 fraction of bucket

34 / 75

Page 71: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – construction

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

Let H be a (2B/γ,δ/n)-standard window function. Note that

|Hf | ≤ δ/n

for all f outside of [−γ n

4B,γ

n4B

].

35 / 75

Page 72: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – construction

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

1−γ/2 fraction of bucket

Let H be a (2B/γ,δ/n)-standard window function. Note that

|Hf | ≤ δ/n

for all f outside of [−γ n

4B,γ

n4B

].

36 / 75

Page 73: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – construction

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

Let H be a (2B/γ,δ/n)-standard window function. Note that

|Hf | ≤ δ/n

for all f outside of [−γ n

4B,γ

n4B

].

37 / 75

Page 74: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – construction

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

Let H be a (2B/γ,δ/n)-standard window function. Note that

|Hf | ≤ δ/n

for all f outside of [−γ n

4B,γ

n4B

].

38 / 75

Page 75: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

39 / 75

Page 76: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

39 / 75

Page 77: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

39 / 75

Page 78: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

39 / 75

Page 79: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

40 / 75

Page 80: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

40 / 75

Page 81: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 82: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 83: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 84: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 85: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 86: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 87: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 88: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 89: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function – constructionTo construct G:

1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B2. normalize so that G0 = 1±δ

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

41 / 75

Page 90: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

To construct G:1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B

2. normalize so that G0 = 1±δ

Formally:

Gf :=1Z

(H f−U + H f+1−U + . . .+ H f+U

)where Z is a normalization factor.

Upon inspection, Z =∑f∈[n] Hf works.

42 / 75

Page 91: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

To construct G:1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B

2. normalize so that G0 = 1±δ

Formally:

Gf :=1Z

(H f−U + H f+1−U + . . .+ H f+U

)where Z is a normalization factor.

Upon inspection, Z =∑f∈[n] Hf works.

42 / 75

Page 92: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

To construct G:1. sum up shifts H ·−∆ over all ∆ ∈ [−U ,U], where

U = (1−γ/2)n

2B

2. normalize so that G0 = 1±δ

Formally:

Gf :=1Z

(H f−U + H f+1−U + . . .+ H f+U

)where Z is a normalization factor.

Upon inspection, Z =∑f∈[n] Hf works.

43 / 75

Page 93: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Formally:

Gf :=1Z

(H f−U + H f+1−U + . . .+ H f+U

)where Z is a normalization factor.

Upon inspection, Z =∑f∈[n] Hf works.

(Flat region) For any f ∈ [−(1−γ) n2B ,(1−γ) n

2B ] (flat region) onehas

H f−U + H f+1−U + . . .+ H f+U ≥ ∑f∈[−γ n

4B ,γ n4B ]

Hf

≥Z − tail of H≥Z − (δ/n)n ≥Z −δ

44 / 75

Page 94: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Formally:

Gf :=1Z

(H f−U + H f+1−U + . . .+ H f+U

)where Z is a normalization factor.

Upon inspection, Z =∑f∈[n] Hf works.

Indeed, for any f 6∈ [− n2B , n

2B ] (zero region) one has

H f−U + H f+1−U + . . .+ H f+U ≤ ∑f>γ n

4B

Hf

≤ tail of H ≤ (δ/n)n ≤ δ

45 / 75

Page 95: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

How large is support of G := 1Z

(H ·−U + . . .+ H ·+U

)?

By time shift theorem for every q ∈ [n]

Gq :=Hq · 1Z

U∑j=−U

ωqj

Support of G a subset of support of H!

46 / 75

Page 96: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

How large is support of G := 1Z

(H ·−U + . . .+ H ·+U

)?

By time shift theorem for every q ∈ [n]

Gq :=Hq · 1Z

U∑j=−U

ωqj

Support of G a subset of support of H!

46 / 75

Page 97: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window function

− n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

How large is support of G := 1Z

(H ·−U + . . .+ H ·+U

)?

By time shift theorem for every q ∈ [n]

Gq :=Hq · 1Z

U∑j=−U

ωqj

Support of G a subset of support of H!46 / 75

Page 98: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Flat window functions – construction

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

*

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

=

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

-0.2

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

47 / 75

Page 99: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

1. Pseudorandom spectrum permutations

2. Filter construction

3. Basic block: partial recovery

4. Full algorithm

48 / 75

Page 100: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block

AssumeÏ n is a power of 2

Ï x contains at most k coefficients with polynomial precision(e.g. xf in −nO(1), . . . ,nO(1))

Then there exists an O(k logn) time algorithm that

Ï outputs at most k potential coefficients

Ï outputs each nonzero xf correctly with probability at least1−β for a constant β> 0

49 / 75

Page 101: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

n2B 0 n

2B

ideal bucket

leakage to other buckets

bounded by δ¿ 1

1−γ fraction of bucket

Let G be a (B,δ/n,γ)-flat window function:Ï B bucketsÏ flat region of width 1−γÏ leakage ≤ δ/n = 1/nO(1)

Such G can be constructed with

supp(G)=O((k/γ) logn)

50 / 75

Page 102: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – algorithm

Main idea: filter, then run 1-sparse algorithm on eachsubproblem

PARTIALRECOVERY(x ,B,γ,δ)

Choose random b ∈ [n] and odd σ ∈ 1,2, . . . ,n

Define x ′j ← xσjω

jb

Define

x ′′j ← x ′

j+1

Compute c′j · n

B, j ∈ [B], where c′ = x ′ ·G

Compute

c′′j · n

B, j ∈ [B], where c′′ = x ′′ ·G

Run 1-sparse decoding one c′, c′′

51 / 75

Page 103: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – algorithm

Recovering 5-sparse signal x from measurements of x

Permute spectrum

Filter signal

1-sparse decoding

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Isolated frequencies are decoded successfully

52 / 75

Page 104: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – algorithm

Recovering 5-sparse signal x from measurements of x

Permute spectrum

Filter signal

1-sparse decoding

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Isolated frequencies are decoded successfully

53 / 75

Page 105: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – algorithm

Recovering 5-sparse signal x from measurements of x

Permute spectrum

Filter signal

1-sparse decoding

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Isolated frequencies are decoded successfully

54 / 75

Page 106: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – algorithm

Recovering 5-sparse signal x from measurements of x

Permute spectrum

Filter signal

1-sparse decoding

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Isolated frequencies are decoded successfully

55 / 75

Page 107: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – algorithm

Choose random b ∈ [n] and oddσ ∈ 1,2, . . . ,n

Define x ′j ← xσjω

jb

Define

x ′′j ← x ′

j+1

Compute c′j · n

B, j ∈ [B], where c′ = x ′ ·G

Compute

c′′j · n

B, j ∈ [B], where c′′ = x ′′ ·G

For j ∈ [B]If |c′

j ·n/B | > 1/2Decode from c′

j ·n/B , c′′j ·n/B

(Two-point sampling)End

End

56 / 75

Page 108: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).

Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

57 / 75

Page 109: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

57 / 75

Page 110: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 111: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 112: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 113: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 114: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 115: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 116: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 117: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 118: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Basic block – analysisClaimFor each u ∈ supp(x) the probability that u is not reported isbounded by O(k/B+γ).Proof.Probability of being mapped

Ï within n/B of another frequency is O(k/B)

Ï close to boundary of the bucket is O(γ)

N2B 0 N

2B

ideal bucket

1−γ fraction of bucket

58 / 75

Page 119: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Computing cj ·n/B

Option 1 – directly compute FFT of (x ·G)−T , . . . ,(x ·G)T ,T =O((k/γ) logn)

Ï Can be done in time O((k/γ) log2 n)

Ï Computes too many samples of x ∗ G

Option 2 – alias x ·G to B bins firstÏ Compute

bi =∑

j∈[n/B]

xi+j ·BGi+j ·B

Ï Compute FFT of b in time

O(B logB)=O((k/γ) logn)

59 / 75

Page 120: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Computing cj ·n/B

Option 1 – directly compute FFT of (x ·G)−T , . . . ,(x ·G)T ,T =O((k/γ) logn)

Ï Can be done in time O((k/γ) log2 n)

Ï Computes too many samples of x ∗ G

Option 2 – alias x ·G to B bins firstÏ Compute

bi =∑

j∈[n/B]

xi+j ·BGi+j ·B

Ï Compute FFT of b in time

O(B logB)=O((k/γ) logn)

59 / 75

Page 121: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

1. Pseudorandom spectrum permutations

2. Filter construction

3. Basic block: partial recovery

4. Full algorithm

60 / 75

Page 122: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,C ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,C ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/8, 116 ·8−1,1/poly(n))

. . .

61 / 75

Page 123: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,C ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,C ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/8, 116 ·8−1,1/poly(n))

. . .

61 / 75

Page 124: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,C ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,C ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/8, 116 ·8−1,1/poly(n))

. . .

61 / 75

Page 125: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,C ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,C ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/8, 116 ·8−1,1/poly(n))

. . .

61 / 75

Page 126: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,C ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,C ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,C ·k/8, 116 ·8−1,1/poly(n))

. . .

61 / 75

Page 127: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,10 ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/8, 116 ·8−1,1/poly(n))

. . .

62 / 75

Page 128: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,10 ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/8, 116 ·8−1,1/poly(n))

. . .

62 / 75

Page 129: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,10 ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/8, 116 ·8−1,1/poly(n))

. . .

62 / 75

Page 130: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,10 ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/8, 116 ·8−1,1/poly(n))

. . .

62 / 75

Page 131: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Let C > 0 be a sufficiently large constant.

PARTIALRECOVERY(x ,10 ·k

/2

, 116

·2−1

,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/2, 116 ·2−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/4, 116 ·4−1,1/poly(n))

PARTIALRECOVERY(x ,10 ·k/8, 116 ·8−1,1/poly(n))

. . .

62 / 75

Page 132: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 133: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 134: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 135: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 136: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 137: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 138: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 139: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

Permute spectrum

Hash to 8 buckets

Recover isolated coeffs

Permute spectrum

Hash to 4 buckets

Recover isolated coeffs

. . .0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

63 / 75

Page 140: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Modified PARTIALRECOVERY

PARTIALRECOVERY(B,α,List)

Choose random b, odd σ

Define x ′j = xσjω

jb

Define

x ′′j = x ′

j+1

Compute c′j · n

B, j ∈ [B], where c′ = x ′ ·G

Compute

c′′j · n

B, j ∈ [B], where c′′ = x ′′ ·G

For j ∈ [B]If |c′

j ·n/B | > 1/2Decode from c′

j ·n/B , c′′j ·n/B

(Two-point sampling)End

End

So c′ = x ′∗ G

So c′′ = x ′′∗ G

64 / 75

Page 141: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – updating the bins

Previously located elements are still in the signal...

Subtract recovered elements from the bins

For each (pos,val) ∈ Listu ←σ ·pos−b

j ← closest bin to u

off ← u− jn/B

c′j ·n/B ← c′

j ·n/B −val · Goff

c′′j ·n/B ← c′′

j ·n/B −val ·ωu · Goff

End

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

65 / 75

Page 142: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY – updating the bins

Previously located elements are still in the signal...

Subtract recovered elements from the bins

For each (pos,val) ∈ Listu ←σ ·pos−b

j ← closest bin to u

off ← u− jn/B

c′j ·n/B ← c′

j ·n/B −val · Goff

c′′j ·n/B ← c′′

j ·n/B −val ·ωu · Goff

End

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

66 / 75

Page 143: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm

List←;For t = 0 to logk

Bt ←Ck/4t . # of buckets to hash to

γt ← 1/(C2t) . sharpness of filter

List ← List +PARTIALRECOVERY(Bt ,γt ,List)End

67 / 75

Page 144: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm – analysisLet

et ← contents of the list after stage t .

Define ‘good event’ Et as

Et :=||x − et ||0 ≤ k/8t

Conditional on Et−1, for every f ∈ [n] the probability of failure torecover is at most the sum of

Ï probability of collision with another element, which is no morethan

k/8t

Bt= k/8t

C ·k/4t ≤1

C ·2t

Ï probability of being hashed to the non-flat region, which is nomore than

O(γt )=O(

1C2t

)

68 / 75

Page 145: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm – analysisLet

et ← contents of the list after stage t .

Define ‘good event’ Et as

Et :=||x − et ||0 ≤ k/8t

Conditional on Et−1, for every f ∈ [n] the probability of failure torecover is at most the sum of

Ï probability of collision with another element, which is no morethan

k/8t

Bt= k/8t

C ·k/4t ≤1

C ·2t

Ï probability of being hashed to the non-flat region, which is nomore than

O(γt )=O(

1C2t

)

68 / 75

Page 146: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm – analysisLet

et ← contents of the list after stage t .

Define ‘good event’ Et as

Et :=||x − et ||0 ≤ k/8t

Conditional on Et−1, for every f ∈ [n] the probability of failure torecover is at most the sum of

Ï probability of collision with another element, which is no morethan

k/8t

Bt= k/8t

C ·k/4t ≤1

C ·2t

Ï probability of being hashed to the non-flat region, which is nomore than

O(γt )=O(

1C2t

)68 / 75

Page 147: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm – analysis

Define ‘good event’ Et as

Et :=||x − et ||0 ≤ k/8t

Then

Pr[Et |Et−1]≤Pr[fraction of failures is≥ 1/8|Et−1]≤O(

1C ·2t

)

So for a sufficiently large C > 0

Pr[E 1 ∨ . . .∨E logk ]≤O(1/C) · (1/2+1/4+ . . .)=O(1/C)< 1/10

69 / 75

Page 148: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm – analysis

Define ‘good event’ Et as

Et :=||x − et ||0 ≤ k/8t

Then

Pr[Et |Et−1]≤Pr[fraction of failures is≥ 1/8|Et−1]≤O(

1C ·2t

)

So for a sufficiently large C > 0

Pr[E 1 ∨ . . .∨E logk ]≤O(1/C) · (1/2+1/4+ . . .)=O(1/C)< 1/10

69 / 75

Page 149: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Full algorithm – analysis

List←;For t = 1 to logk

Bt ←Ck/4t

γt ← 1/(C2t)

List ← List +PARTIALRECOVERY(Bt ,γt ,List)End

Time complexity

Ï DFT:O(k logn)+O((k/4) logn)+ . . . =O(k logn)

Ï List update: k · logn

70 / 75

Page 150: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Sample complexity

List←;For t = 1 to logk

Bt ←Ck/4t

γt ← 1/(C2t)

List ← List +PARTIALRECOVERY(Bt ,γt ,List)End

Sample complexity O(k logn)+O((k/4) logn)+ . . . =O(k logn)

Suboptimal: sufficient to measure x0,x1, . . . ,x2k to reconstructx if supp(x)≤ k (exercise).

71 / 75

Page 151: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY (noisy setting)

Choose random b ∈ [n] and oddσ ∈ 1,2, . . . ,n

Define x ′j ← xσjω

jb

Define

x ′′j ← x ′

j+1

Compute c′j · n

B, j ∈ [B], where c′ = x ′ ·G

Compute

c′′j · n

B, j ∈ [B], where c′′ = x ′′ ·G

For j ∈ [B]If |c′

j ·n/B | > 1/2Decode from c′

j ·n/B , c′′j ·n/B

(Two-point sampling)End

End

72 / 75

Page 152: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

PARTIALRECOVERY (noisy setting)Choose random b ∈ [n] and oddσ ∈ 1,2, . . . ,n

Define xs,0,rj ← xσ(j+r)ω

(j+r)b

Define

xs,1,rj ← xs,0,r

j+n/2s+1

Compute á(xs,0,r ·G)j ·n/B , for j ∈ [B]

Compute

á(xs,1,r ·G)j ·n/B , for j ∈ [B]

For j ∈ [B]If |c′

j ·n/B | > 1/2

Decode from xs,0,rj ·n/B

(As in lecture 1)End

End

For s = 0, . . . , log2 n

For

r = 1, . . . ,O(loglogn)

(or decode top k elements)

73 / 75

Page 153: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Runtime and sample complexity

Noiseless: runtime O(k logn), sample complexityO(k logn loglogn)

Noisy: runtime O(k log2 n), sample complexityO(k log2 n loglogn)

O(loglogn) can be removed, seeHassanieh-Indyk-Katabi-Price’STOC12

Sample complexity lower bound: Ω(k log(n/k)) (Do Ba, Indyk,Price, Woodruff’SODA10)

74 / 75

Page 154: Sparse Fourier Transform (lecture 2) - People | MIT CSAILpeople.csail.mit.edu/kapralov/madalgo15/lec2.pdf · 2015. 8. 13. · Given x 2Cn, compute the Discrete Fourier Transform of

Next lecture:

O(k logn) samples and O(n log3 n) runtime(Indyk-Kapralov’FOCS14)

75 / 75