Алгоритмы быстрого вычисления разреженного...

125
Sparse Fourier Transform (lecture 1) Michael Kapralov 1 1 IBM Watson EPFL St. Petersburg CS Club November 2015 1 / 73

Transcript of Алгоритмы быстрого вычисления разреженного...

Page 1: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform(lecture 1)

Michael Kapralov1

1IBM Watson → EPFL

St. Petersburg CS ClubNovember 2015

1 / 73

Page 2: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Given x ∈Cn, compute the Discrete Fourier Transform (DFT) ofx :

xi =1n

∑j∈[n]

xj ·ω−ij ,

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

Assume that n is a power of 2.

compression schemes(JPEG, MPEG)

signal processingdata analysis

imaging (MRI, NMR)

2 / 73

Page 3: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Given x ∈Cn, compute the Discrete Fourier Transform (DFT) ofx :

xi =1n

∑j∈[n]

xj ·ω−ij ,

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

Assume that n is a power of 2.

compression schemes(JPEG, MPEG)

signal processingdata analysis

imaging (MRI, NMR)

2 / 73

Page 4: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Given x ∈Cn, compute the Discrete Fourier Transform (DFT) ofx :

xi =1n

∑j∈[n]

xj ·ω−ij ,

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

Assume that n is a power of 2.

compression schemes(JPEG, MPEG)

signal processingdata analysis

imaging (MRI, NMR)

2 / 73

Page 5: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

DFT has numerous applications:

3 / 73

Page 6: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Fast Fourier Transform (FFT)

Computes Discrete Fourier Transform (DFT) of a length nsignal in O(n logn) time

Cooley and Tukey, 1964

Gauss, 1805

Code=FFTW (Fastest Fourier Transform in the West)

4 / 73

Page 7: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Fast Fourier Transform (FFT)

Computes Discrete Fourier Transform (DFT) of a length nsignal in O(n logn) time

Cooley and Tukey, 1964

Gauss, 1805

Code=FFTW (Fastest Fourier Transform in the West)

4 / 73

Page 8: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Fast Fourier Transform (FFT)

Computes Discrete Fourier Transform (DFT) of a length nsignal in O(n logn) time

Cooley and Tukey, 1964

Gauss, 1805

Code=FFTW (Fastest Fourier Transform in the West)

5 / 73

Page 9: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Fast Fourier Transform (FFT)

Computes Discrete Fourier Transform (DFT) of a length nsignal in O(n logn) time

Cooley and Tukey, 1964

Gauss, 1805

Code=FFTW (Fastest Fourier Transform in the West)

6 / 73

Page 10: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse FFT

Say that x is k -sparse if x has k nonzero entries

Say that x is approximately k -sparse if x is close to k -sparse insome norm (`2 for this lecture)

-0.0004

-0.0002

0

0.0002

0.0004

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

7 / 73

Page 11: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse FFT

Say that x is k -sparse if x has k nonzero entries

Say that x is approximately k -sparse if x is close to k -sparse insome norm (`2 for this lecture)

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

8 / 73

Page 12: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse approximations

JPEG=⇒

Given x , compute x , then keep top k coefficients only for k ¿N

Used in image and video compression schemes(e.g. JPEG, MPEG)

9 / 73

Page 13: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse approximations

JPEG=⇒

Given x , compute x , then keep top k coefficients only for k ¿N

Used in image and video compression schemes(e.g. JPEG, MPEG)

10 / 73

Page 14: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Computing approximation fast

Basic approach:

Ï FFT computes x from x in O(n logn) time

Ï compute top k coefficients in O(n) time.

Sparse FFT:Ï directly computes k largest coefficients of x (approximately

– formal def later)

Ï Running time O(k log2 n) or faster

Ï Sublinear time!

11 / 73

Page 15: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Computing approximation fast

Basic approach:

Ï FFT computes x from x in O(n logn) time

Ï compute top k coefficients in O(n) time.

Sparse FFT:Ï directly computes k largest coefficients of x (approximately

– formal def later)

Ï Running time O(k log2 n) or faster

Ï Sublinear time!

11 / 73

Page 16: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

Sample complexity=number of samples accessed in timedomain.

12 / 73

Page 17: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

In medical imaging (MRI, NMR), one measures Fouriercoefficients x of imaged object x (which is often sparse)

13 / 73

Page 18: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

In medical imaging (MRI, NMR), one measures Fouriercoefficients x of imaged object x (which is often sparse)

13 / 73

Page 19: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

Measure x ∈Cn, compute the Inverse Discrete FourierTransform (IDFT) of x :

xi =∑

j∈[n]xj ·ωij .

Given x ∈Cn, compute the Discrete Fourier Transform (DFT) ofx :

xi =1n

∑j∈[n]

xj ·ω−ij .

Sample complexity=number of samples accessed in timedomain.

Governs the measurement complexity of imaging process.

14 / 73

Page 20: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

Measure x ∈Cn, compute the Inverse Discrete FourierTransform (IDFT) of x :

xi =∑

j∈[n]xj ·ωij .

Given x ∈Cn, compute the Discrete Fourier Transform (DFT) ofx :

xi =1n

∑j∈[n]

xj ·ω−ij .

Sample complexity=number of samples accessed in timedomain.

Governs the measurement complexity of imaging process.

14 / 73

Page 21: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

Measure x ∈Cn, compute the Inverse Discrete FourierTransform (IDFT) of x :

xi =∑

j∈[n]xj ·ωij .

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

xi =1n

∑j∈[n]

xj ·ω−ij .

Sample complexity=number of samples accessed in timedomain.

Governs the measurement complexity of imaging process.

15 / 73

Page 22: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sample complexity

Measure x ∈Cn, compute the Inverse Discrete FourierTransform (IDFT) of x :

xi =∑

j∈[n]xj ·ωij .

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

xi =1n

∑j∈[n]

xj ·ω−ij .

Sample complexity=number of samples accessed in timedomain.

Governs the measurement complexity of imaging process.

15 / 73

Page 23: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Given access to signal x in time domain, find best k -sparseapproximation to x approximately

Minimize

1. runtime

2. number of samples

16 / 73

Page 24: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Algorithms

Ï RandomizationÏ ApproximationÏ HashingÏ SketchingÏ . . .

Signal processing

Ï Fourier transformÏ Hadamard transformÏ FiltersÏ Compressive sensingÏ . . .

17 / 73

Page 25: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Ï Lecture 1: summary of techniques fromGilbert-Guha-Indyk-Muthukrishnan-Strauss’02, Akavia-Goldwasser-Safra’03,

Gilbert-Muthukrishnan-Strauss’05, Iwen’10, Akavia’10,

Hassanieh-Indyk-Katabi-Price’12a, Hassanieh-Indyk-Katabi-Price’12b

Ï Lecture 2: Algorithm with O(k logn) runtime (noiselesscase) Hassanieh-Indyk-Katabi-Price’12b

Ï Lecture 3: Algorithm with O(k log2 n) runtime (noisy case)Hassanieh-Indyk-Katabi-Price’12b

Ï Lecture 4: Algorithm with O(k logn) sample complexityIndyk-Kapralov-Price’14, Indyk-Kapralov’14

18 / 73

Page 26: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Outline

1. Computing Fourier transform of 1-sparse signals fast

2. Sparsity k > 1: main ideas and challenges

19 / 73

Page 27: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Outline

1. Computing Fourier transform of 1-sparse signals fast

2. Sparsity k > 1: main ideas and challenges

20 / 73

Page 28: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)

Warmup: x is exactly 1-sparse: xf = 0 when f 6= f ∗ for some f ∗

-0.0004

-0.0002

0

0.0002

0.0004

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

f ∗

Note: signal is a pure frequency

Given: access to x

Need: find f ∗ and xf ∗

21 / 73

Page 29: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency, so xj = a ·ωf ∗·j

+noise

Sample x0,x1

We have

x0 = a

+noise

x1 = a ·ωf ∗

+noise

So

x1/x0 =ωf ∗

+noise

Can read frequency from theangle!

ωf ∗

unit circle

x0 = a

x1 = a ·ωf ∗

Pro: constant time algorithmCon: depends heavily on the signal being pure

22 / 73

Page 30: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency, so xj = a ·ωf ∗·j

+noise

Sample x0,x1

We have

x0 = a

+noise

x1 = a ·ωf ∗

+noise

So

x1/x0 =ωf ∗

+noise

Can read frequency from theangle!

ωf ∗

unit circle

x0 = a

x1 = a ·ωf ∗

Pro: constant time algorithmCon: depends heavily on the signal being pure

22 / 73

Page 31: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency, so xj = a ·ωf ∗·j

+noise

Sample x0,x1

We have

x0 = a

+noise

x1 = a ·ωf ∗

+noise

So

x1/x0 =ωf ∗

+noise

Can read frequency from theangle!

ωf ∗

unit circle

x0 = a

x1 = a ·ωf ∗

Pro: constant time algorithmCon: depends heavily on the signal being pure

23 / 73

Page 32: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency, so xj = a ·ωf ∗·j

+noise

Sample x0,x1

We have

x0 = a

+noise

x1 = a ·ωf ∗

+noise

So

x1/x0 =ωf ∗

+noise

Can read frequency from theangle!

ωf ∗

unit circle

x0 = a

x1 = a ·ωf ∗

Pro: constant time algorithmCon: depends heavily on the signal being pure

24 / 73

Page 33: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency, so xj = a ·ωf ∗·j

+noise

Sample x0,x1

We have

x0 = a

+noise

x1 = a ·ωf ∗

+noise

So

x1/x0 =ωf ∗

+noise

Can read frequency from theangle!

ωf ∗

unit circle

x0 = a

x1 = a ·ωf ∗

Pro: constant time algorithmCon: depends heavily on the signal being pure

25 / 73

Page 34: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency, so xj = a ·ωf ∗·j

+noise

Sample x0,x1

We have

x0 = a

+noise

x1 = a ·ωf ∗

+noise

So

x1/x0 =ωf ∗

+noise

Can read frequency from theangle!

ωf ∗

unit circle

x0 = a

x1 = a ·ωf ∗

Pro: constant time algorithmCon: depends heavily on the signal being pure 26 / 73

Page 35: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency+noise, so xj = a ·ωf ∗·j+noise

Sample x0,x1

We have

x0 = a+noise

x1 = a ·ωf ∗+noise

So

x1/x0 =ωf ∗+noise

Can read frequency from theangle!

x0 = a

x1 = a ·ωf ∗

ωf ∗

unit circle

Pro: constant time algorithmCon: depends heavily on the signal being pure

27 / 73

Page 36: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency+noise, so xj = a ·ωf ∗·j+noise

Sample x0,x1

We have

x0 = a+noise

x1 = a ·ωf ∗+noise

So

x1/x0 =ωf ∗+noise

Can read frequency from theangle!

x0 = a

x1 = a ·ωf ∗

ωf ∗

unit circle

Pro: constant time algorithmCon: depends heavily on the signal being pure

28 / 73

Page 37: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Two-point samplingInput signal x is a pure frequency+noise, so xj = a ·ωf ∗·j+noise

Sample x0,x1

We have

x0 = a+noise

x1 = a ·ωf ∗+noise

So

x1/x0 =ωf ∗+noise

Can read frequency from theangle!

x0 = a

x1 = a ·ωf ∗

ωf ∗

unit circle

Pro: constant time algorithmCon: depends heavily on the signal being pure

29 / 73

Page 38: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)Warmup – part 2: x is 1-sparse plus noise

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

Note: signal is a pure frequency plus noise

Given: access to x

Need: find f ∗ and xf ∗

Ideally, find pure frequency x ′ that approximates x best

30 / 73

Page 39: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)Warmup – part 2: x is 1-sparse plus noise

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noise

head

Note: signal is a pure frequency plus noise

Given: access to x

Need: find f ∗ and xf ∗

Ideally, find pure frequency x ′ that approximates x best

31 / 73

Page 40: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)Warmup – part 2: x is 1-sparse plus noise

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

Note: signal is a pure frequency plus noise

Given: access to x

Need: find f ∗ and xf ∗

Ideally, find pure frequency x ′ that approximates x best

32 / 73

Page 41: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)Warmup – part 2: x is 1-sparse plus noise

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

Note: signal is a pure frequency plus noise

Ideally, find pure frequency x ′ that approximates x best:

min1−sparse x ′

||x − x ′||2

= ||tail noise||2

33 / 73

Page 42: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)Warmup – part 2: x is 1-sparse plus noise

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noise

head

Note: signal is a pure frequency plus noise

Ideally, find pure frequency x ′ that approximates x best:

min1−sparse x ′

||x − x ′||2

= ||tail noise||2

34 / 73

Page 43: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparse Fourier Transform (k = 1)Warmup – part 2: x is 1-sparse plus noise

-0.0006

-0.0004

-0.0002

0

0.0002

0.0004

0.0006

-1000 -500 0 500 1000

time

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noise

head

Note: signal is a pure frequency plus noise

Ideally, find pure frequency x ′ that approximates x best:

min1−sparse x ′

||x − x ′||2 = ||tail noise||2

35 / 73

Page 44: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

`2/`2 sparse recovery

Ideally, find pure frequency x ′ that approximates x best

Need to allow approximation: find y such that

||x − y ||2 ≤C · ||tail noise||2where C > 1 is the approximation factor.

36 / 73

Page 45: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

`2/`2 sparse recovery

Ideally, find pure frequency x ′ that approximates x best

Need to allow approximation: find y such that

||x − y ||2 ≤ 3 · ||tail noise||2

37 / 73

Page 46: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Approximation guaranteeFind y such that

||x − y ||2 ≤ 3 · ||tail noise||2

Note: only meaningful if

||x ||2 > 3 · ||tail noise||2or, equivalently,∑

f 6=f ∗|xf |2 ≤ ε|a|2

(assumethisforthelecture)

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Assume that this holds for a small enough ε> 0

38 / 73

Page 47: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Approximation guaranteeFind y such that

||x − y ||2 ≤ 3 · ||tail noise||2

Note: only meaningful if

||x ||2 > 3 · ||tail noise||2or, equivalently,∑

f 6=f ∗|xf |2 ≤ ε|a|2 (assumethisforthelecture)

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

Assume that this holds for a small enough ε> 0

39 / 73

Page 48: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Approximation guaranteeFind y such that

||x − y ||2 ≤ 3 · ||tail noise||2

Note: only meaningful if

||x ||2 > 3 · ||tail noise||2or, equivalently,

(assume this for the lecture)

∑f 6=f ∗

|xf |2 ≤ ε|a|2

(assume this for the lecture)

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

40 / 73

Page 49: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Approximation guaranteeFind y such that

||x − y ||2 ≤ 3 · ||tail noise||2

Note: only meaningful if

||x ||2 > 3 · ||tail noise||2or, equivalently,

(assume this for the lecture)

∑f 6=f ∗

|xf |2 ≤ ε|a|2 (assume this for the lecture)

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

41 / 73

Page 50: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Approximation guaranteeFind y such that

||x − y ||2 ≤ 3 · ||tail noise||2

Note: only meaningful if

||x ||2 > 3 · ||tail noise||2or, equivalently,

(assume this for the lecture)

∑f 6=f ∗

|xf |2 ≤ ε|a|2 (assume this for the lecture)

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

42 / 73

Page 51: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Approximation guaranteeFind y such that

||x − y ||2 ≤ 3 · ||tail noise||2

Note: only meaningful if

||x ||2 > 3 · ||tail noise||2or, equivalently,

(assume this for the lecture)

∑f 6=f ∗

|xf |2 ≤ ε|a|2 (assume this for the lecture)

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

43 / 73

Page 52: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

A robust algorithm for finding the heavy hitter

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

Assume that∑

f 6=f ∗|xf |2 ≤ ε|a|2

Describe algorithm for the noiseless case first (ε= 0)

Suppose that xj = a ·ωf ∗·j .

Will find f ∗ bit by bit (binary search).

44 / 73

Page 53: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

A robust algorithm for finding the heavy hitter

0

0.2

0.4

0.6

0.8

1

-1000 -500 0 500 1000

frequency

tail noisehead

Assume that∑

f 6=f ∗|xf |2 ≤ ε|a|2

Describe algorithm for the noiseless case first (ε= 0)

Suppose that xj = a ·ωf ∗·j .

Will find f ∗ bit by bit (binary search).44 / 73

Page 54: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0Suppose that f ∗ = 2f +b, we want b

ComputeÏ x0 = aÏ xn/2 = a ·ωf ∗·(n/2)

ClaimWe have

xn/2 = x0 · (−1)b

(Even frequencies are n/2-periodic, odd are n/2-antiperiodic)

Proof.

xn/2 = a ·ωf ∗(n/2) = a · (−1)2f+b = x0 · (−1)b

Will need arbitrary r ’s for the noisy setting

45 / 73

Page 55: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0Suppose that f ∗ = 2f +b, we want b

ComputeÏ x0 = aÏ xn/2 = a ·ωf ∗·(n/2)

ClaimWe have

xn/2 = x0 · (−1)b

(Even frequencies are n/2-periodic, odd are n/2-antiperiodic)

Proof.

xn/2 = a ·ωf ∗(n/2) = a · (−1)2f+b = x0 · (−1)b

Will need arbitrary r ’s for the noisy setting

45 / 73

Page 56: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0Suppose that f ∗ = 2f +b, we want b

ComputeÏ x0+r = a ·ωf∗r

Ï xn/2+r = a ·ωf ∗(n/2+r)

ClaimFor all r ∈ [n] we have

xn/2+r = x0+r · (−1)b

(Even frequencies are n/2-periodic, odd are n/2-antiperiodic)

Proof.

xn/2+r = a ·ωf ∗(n/2+r) = a ·ωf∗r · (−1)2f+b = x0+r · (−1)b

Will need arbitrary r ’s for the noisy setting

46 / 73

Page 57: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0Suppose that f ∗ = 2f +b, we want b

ComputeÏ xr = a ·ωf∗r

Ï xn/2+r = a ·ωf ∗(n/2+r)

ClaimFor all r ∈ [n] we have

xn/2+r = xr · (−1)b

(Even frequencies are n/2-periodic, odd are n/2-antiperiodic)

Proof.

xn/2+r = a ·ωf ∗(n/2+r) = a ·ωf∗r · (−1)2f+b = xr · (−1)b

Will need arbitrary r ’s for the noisy setting

47 / 73

Page 58: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0Suppose that f ∗ = 2f +b, we want b

ComputeÏ xr = a ·ωf∗r

Ï xn/2+r = a ·ωf ∗(n/2+r)

ClaimFor all r ∈ [n] we have

xn/2+r = xr · (−1)b

(Even frequencies are n/2-periodic, odd are n/2-antiperiodic)

Proof.

xn/2+r = a ·ωf ∗(n/2+r) = a ·ωf∗r · (−1)2f+b = xr · (−1)b

Will need arbitrary r ’s for the noisy setting

48 / 73

Page 59: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0 test

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Correctness:

If b = 0, then |xn/2+r +xr | = 2|xr | = 2|a|

If b = 0,

and

n

|xn/2+r −xr | = 0

If b = 1, then |xn/2+r +xr | = 0

If b = 0,

and

n

|xn/2+r −xr | = 2|xr | = 2|a|

49 / 73

Page 60: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0 test

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Correctness:

If b = 0, then |xn/2+r +xr | = 2|xr | = 2|a|

If b = 0,

and

n

|xn/2+r −xr | = 0

If b = 1, then |xn/2+r +xr | = 0

If b = 0,

and

n

|xn/2+r −xr | = 2|xr | = 2|a|

49 / 73

Page 61: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 0 test

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Correctness:

If b = 0, then |xn/2+r +xr | = 2|xr | = 2|a|

If b = 0,

and

n

|xn/2+r −xr | = 0

If b = 1, then |xn/2+r +xr | = 0

If b = 0,

and

n

|xn/2+r −xr | = 2|xr | = 2|a|

49 / 73

Page 62: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Can pretend that b0 = 0. Why?

Claim (Time shift theorem)If yj = xj ·ωj ·∆, then yf = xf−∆.

Proof.

yf =1n

∑j∈[n]

yj ·ω−fj = 1n

∑j∈[n]

xj ·ωj ·∆ ·ω−fj

= 1n

∑j∈[n]

xj ·ω−j ·(f−∆)

= xf−∆

If b0 = 1, then replace x with yj := xj ·ωj ·b0 .

50 / 73

Page 63: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Can pretend that b0 = 0. Why?

Claim (Time shift theorem)If yj = xj ·ωj ·∆, then yf = xf−∆.

Proof.

yf =1n

∑j∈[n]

yj ·ω−fj = 1n

∑j∈[n]

xj ·ωj ·∆ ·ω−fj

= 1n

∑j∈[n]

xj ·ω−j ·(f−∆)

= xf−∆

If b0 = 1, then replace x with yj := xj ·ωj ·b0 .50 / 73

Page 64: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Assume b0 = 0. Then we have f ∗ = 2f , so

xj = a ·ωf ∗j = a ·ω2f ·j = a ·ωf ·jN/2.

Let zj := x2j , i.e. spectrum of z contains even components ofspectrum of x

ThenÏ (x0, . . . ,xN/2−1)= (z0, . . . ,zN/2−1) are time samples of zj ;

andÏ zf = a is the heavy hitter in z.

So by previous derivation zN/4+r = zr · (−1)b1

And hencexn/4+rω

(n/4+r)b0 = xrωr ·b0 · (−1)b1

51 / 73

Page 65: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Assume b0 = 0. Then we have f ∗ = 2f , so

xj = a ·ωf ∗j = a ·ω2f ·j = a ·ωf ·jN/2.

Let zj := x2j , i.e. spectrum of z contains even components ofspectrum of x

ThenÏ (x0, . . . ,xN/2−1)= (z0, . . . ,zN/2−1) are time samples of zj ;

andÏ zf = a is the heavy hitter in z.

So by previous derivation zN/4+r = zr · (−1)b1

And hencexn/4+rω

(n/4+r)b0 = xrωr ·b0 · (−1)b1

51 / 73

Page 66: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Assume b0 = 0. Then we have f ∗ = 2f , so

xj = a ·ωf ∗j = a ·ω2f ·j = a ·ωf ·jN/2.

Let zj := x2j , i.e. spectrum of z contains even components ofspectrum of x

ThenÏ (x0, . . . ,xN/2−1)= (z0, . . . ,zN/2−1) are time samples of zj ;

andÏ zf = a is the heavy hitter in z.

So by previous derivation zN/4+r = zr · (−1)b1

And hencexn/4+rω

(n/4+r)b0 = xrωr ·b0 · (−1)b1

51 / 73

Page 67: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Assume b0 = 0. Then we have f ∗ = 2f , so

xj = a ·ωf ∗j = a ·ω2f ·j = a ·ωf ·jN/2.

Let zj := x2j , i.e. spectrum of z contains even components ofspectrum of x

ThenÏ (x0, . . . ,xN/2−1)= (z0, . . . ,zN/2−1) are time samples of zj ;

andÏ zf = a is the heavy hitter in z.

So by previous derivation zN/4+r = zr · (−1)b1

And hencexn/4+rω

(n/4+r)b0 = xrωr ·b0 · (−1)b1

51 / 73

Page 68: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Bit 1Assume b0 = 0. Then we have f ∗ = 2f , so

xj = a ·ωf ∗j = a ·ω2f ·j = a ·ωf ·jN/2.

Let zj := x2j , i.e. spectrum of z contains even components ofspectrum of x

ThenÏ (x0, . . . ,xN/2−1)= (z0, . . . ,zN/2−1) are time samples of zj ;

andÏ zf = a is the heavy hitter in z.

So by previous derivation zN/4+r = zr · (−1)b1

And hencexn/4+rω

(n/4)b0 = xr · (−1)b1

52 / 73

Page 69: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding bit by bit

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Set

and

b1 ← 0 if |ω(n/4)b0xn/4+r +xr | > |ω(n/4)b0xn/4+r −xr |

Set and

b1 ← 1 o.w.

. . . |ω(n/8)(2b1+b0)xn/8+r +xr | > |ω(n/8)(2b1+b0)xn/8+r −xr | . . .

Overall: O(logn) samples to identify f ∗. Runtime O(logn)

53 / 73

Page 70: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding bit by bit

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Set

and

b1 ← 0 if |ω(n/4)b0xn/4+r +xr | > |ω(n/4)b0xn/4+r −xr |

Set and

b1 ← 1 o.w.

. . . |ω(n/8)(2b1+b0)xn/8+r +xr | > |ω(n/8)(2b1+b0)xn/8+r −xr | . . .

Overall: O(logn) samples to identify f ∗. Runtime O(logn)

53 / 73

Page 71: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding bit by bit

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Set

and

b1 ← 0 if |ω(n/4)b0xn/4+r +xr | > |ω(n/4)b0xn/4+r −xr |

Set and

b1 ← 1 o.w.

. . . |ω(n/8)(2b1+b0)xn/8+r +xr | > |ω(n/8)(2b1+b0)xn/8+r −xr | . . .

Overall: O(logn) samples to identify f ∗. Runtime O(logn)

53 / 73

Page 72: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding bit by bit

Set

and

b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr |

Set and

b0 ← 1 o.w.

Set

and

b1 ← 0 if |ω(n/4)b0xn/4+r +xr | > |ω(n/4)b0xn/4+r −xr |

Set and

b1 ← 1 o.w.

. . . |ω(n/8)(2b1+b0)xn/8+r +xr | > |ω(n/8)(2b1+b0)xn/8+r −xr | . . .

Overall: O(logn) samples to identify f ∗. Runtime O(logn)

53 / 73

Page 73: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Noisy setting (dealing with ε)We now have

xj = a ·ωf ∗·j + ∑f 6=f ∗

xfωfj

= a ·ωf ∗·j +µj (µj is the noise in time domain)

Argue that µj is usually small?

Parseval’s equality: noise energy in time domain is proportionalto noise energy in frequency domain:

N−1∑j=0

|µj |2 = n∑

f 6=f ∗|xf |2.

So on average |µj |2 is small:

Ej [|µj |2]≤∑

f 6=f ∗|xf |2 ≤ ε|a|2

54 / 73

Page 74: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Noisy setting (dealing with ε)We now have

xj = a ·ωf ∗·j + ∑f 6=f ∗

xfωfj

= a ·ωf ∗·j +µj (µj is the noise in time domain)

Argue that µj is usually small?

Parseval’s equality: noise energy in time domain is proportionalto noise energy in frequency domain:

N−1∑j=0

|µj |2 = n∑

f 6=f ∗|xf |2.

So on average |µj |2 is small:

Ej [|µj |2]≤∑

f 6=f ∗|xf |2 ≤ ε|a|2

54 / 73

Page 75: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Noisy setting (dealing with ε)We now have

xj = a ·ωf ∗·j + ∑f 6=f ∗

xfωfj

= a ·ωf ∗·j +µj (µj is the noise in time domain)

Argue that µj is usually small?

Parseval’s equality: noise energy in time domain is proportionalto noise energy in frequency domain:

N−1∑j=0

|µj |2 = n∑

f 6=f ∗|xf |2.

So on average |µj |2 is small:

Ej [|µj |2]≤∑

f 6=f ∗|xf |2 ≤ ε|a|2

54 / 73

Page 76: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Need to ensure that:

1. f ∗ is decoded correctly

2. a is estimated well enough to satisfy `2/`2 guarantees:

||x − y ||2 ≤C · ||x − x ′||2

55 / 73

Page 77: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy settingBit 0: set b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr | and b0 ← 1 o.w.

ClaimIf µn/2+r < |a|/2 and µr < |a|/2, then outcome of the bit test isthe same.

Suppose b0 = 1.

Then

|xn/2+r +xr | ≤ |µn/2+r |+ |µr | < |a|

and

|xn/2+r−xr | ≥ 2|a|−|µn/2+r |−|µr | > |a|

xr = a ·ωf ∗·r +µr

xn/2+r = a ·ωf ∗·(n/2+r)+µn/2+r

56 / 73

Page 78: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy settingBit 0: set b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr | and b0 ← 1 o.w.

ClaimIf µn/2+r < |a|/2 and µr < |a|/2, then outcome of the bit test isthe same.

Suppose b0 = 1.

Then

|xn/2+r +xr | ≤ |µn/2+r |+ |µr | < |a|

and

|xn/2+r−xr | ≥ 2|a|−|µn/2+r |−|µr | > |a|

xr = a ·ωf ∗·r +µr

xn/2+r = a ·ωf ∗·(n/2+r)+µn/2+r

56 / 73

Page 79: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy settingBit 0: set b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr | and b0 ← 1 o.w.

ClaimIf µn/2+r < |a|/2 and µr < |a|/2, then outcome of the bit test isthe same.

Suppose b0 = 1.

Then

|xn/2+r +xr | ≤ |µn/2+r |+ |µr | < |a|

and

|xn/2+r−xr | ≥ 2|a|−|µn/2+r |−|µr | > |a|

xr = a ·ωf ∗·r +µr

xn/2+r = a ·ωf ∗·(n/2+r)+µn/2+r

56 / 73

Page 80: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy settingBit 0: set b0 ← 0 if |xn/2+r +xr | > |xn/2+r −xr | and b0 ← 1 o.w.

ClaimIf µn/2+r < |a|/2 and µr < |a|/2, then outcome of the bit test isthe same.

Suppose b0 = 1.

Then

|xn/2+r +xr | ≤ |µn/2+r |+ |µr | < |a|

and

|xn/2+r−xr | ≥ 2|a|−|µn/2+r |−|µr | > |a|

xr = a ·ωf ∗·r +µr

xn/2+r = a ·ωf ∗·(n/2+r)+µn/2+r

56 / 73

Page 81: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy setting

On average |µj |2 is small:

Ej [|µj |2]≤∑

f 6=f ∗|xf |2 ≤ ε|a|2

By Markov’s inequality

Prj [|µj |2 > |a|2/4]≤Prj [|µj |2 > (1/(4ε)) ·Ej [|µj |2]]≤ 4ε

By a union bound

Prr [|µr | ≤ |a|/2 and |µn/2+r | ≤ |a|/2]≥ 1−8ε

Thus, a bit test is correct with probability at least 1−8ε.

57 / 73

Page 82: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy setting

On average |µj |2 is small:

Ej [|µj |2]≤∑

f 6=f ∗|xf |2 ≤ ε|a|2

By Markov’s inequality

Prj [|µj |2 > |a|2/4]≤Prj [|µj |2 > (1/(4ε)) ·Ej [|µj |2]]≤ 4ε

By a union bound

Prr [|µr | ≤ |a|/2 and |µn/2+r | ≤ |a|/2]≥ 1−8ε

Thus, a bit test is correct with probability at least 1−8ε.

57 / 73

Page 83: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy setting

On average |µj |2 is small:

Ej [|µj |2]≤∑

f 6=f ∗|xf |2 ≤ ε|a|2

By Markov’s inequality

Prj [|µj |2 > |a|2/4]≤Prj [|µj |2 > (1/(4ε)) ·Ej [|µj |2]]≤ 4ε

By a union bound

Prr [|µr | ≤ |a|/2 and |µn/2+r | ≤ |a|/2]≥ 1−8ε

Thus, a bit test is correct with probability at least 1−8ε.

57 / 73

Page 84: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy setting

Bit 0: set b0 to zero if

|xn/2+r +xr | > |xn/2+r −xr |

and to 1 otherwise

For ε< 1/64 each test is correct with probability ≥ 3/4.

Final test: perform T À 1 independent tests, use majority vote.

How large should T be? Success probability?

58 / 73

Page 85: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy settingFor j = 1, . . . ,T let

Zj =

1 if j-th test is correct0 o.w.

We have E[Zj ]≥ 3/4.

Chernoff bounds

Pr[T∑

j=1Zj <T/2]< e−Ω(T ).

Set T =O(loglogn)

Majority is correct with probability at least 1−1/(16log2 n)

So all bits correct with probability ≥ 15/16

59 / 73

Page 86: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Decoding in the noisy settingFor j = 1, . . . ,T let

Zj =

1 if j-th test is correct0 o.w.

We have E[Zj ]≥ 3/4.

Chernoff bounds

Pr[T∑

j=1Zj <T/2]< e−Ω(T ).

Set T =O(loglogn)

Majority is correct with probability at least 1−1/(16log2 n)

So all bits correct with probability ≥ 15/16

59 / 73

Page 87: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Estimating the value of heavy hitterRecall that

xr = a ·ωf ∗·r +µr (noise)

Our estimate: pick random r ∈ [n] and output

est← xrω−f∗·r

Expected squared error?

Er [|est −a|2]

=Er [|xrω−f ∗·r −a|2]=Er [|xr −a ·ωf ∗·r |2]=Er [|µr |2]

Now by Markov’s inequality

Prr [|est −a|2 > 4ε|a|2]< 1/4.

60 / 73

Page 88: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Estimating the value of heavy hitterRecall that

xr = a ·ωf ∗·r +µr (noise)

Our estimate: pick random r ∈ [n] and output

est← xrω−f∗·r

Expected squared error?

Er [|est −a|2]

=Er [|xrω−f ∗·r −a|2]=Er [|xr −a ·ωf ∗·r |2]=Er [|µr |2]

Now by Markov’s inequality

Prr [|est −a|2 > 4ε|a|2]< 1/4.

60 / 73

Page 89: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Estimating the value of heavy hitterRecall that

xr = a ·ωf ∗·r +µr (noise)

Our estimate: pick random r ∈ [n] and output

est← xrω−f∗·r

Expected squared error?

Er [|est −a|2]=Er [|xrω−f ∗·r −a|2]

=Er [|xr −a ·ωf ∗·r |2]=Er [|µr |2]

Now by Markov’s inequality

Prr [|est −a|2 > 4ε|a|2]< 1/4.

60 / 73

Page 90: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Estimating the value of heavy hitterRecall that

xr = a ·ωf ∗·r +µr (noise)

Our estimate: pick random r ∈ [n] and output

est← xrω−f∗·r

Expected squared error?

Er [|est −a|2]=Er [|xrω−f ∗·r −a|2]=Er [|xr −a ·ωf ∗·r |2]

=Er [|µr |2]

Now by Markov’s inequality

Prr [|est −a|2 > 4ε|a|2]< 1/4.

60 / 73

Page 91: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Estimating the value of heavy hitterRecall that

xr = a ·ωf ∗·r +µr (noise)

Our estimate: pick random r ∈ [n] and output

est← xrω−f∗·r

Expected squared error?

Er [|est −a|2]=Er [|xrω−f ∗·r −a|2]=Er [|xr −a ·ωf ∗·r |2]=Er [|µr |2]

Now by Markov’s inequality

Prr [|est −a|2 > 4ε|a|2]< 1/4.

60 / 73

Page 92: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Putting it together: algorithm for 1-sparse signals

Let

yf =

est if f = f ∗

0 o.w.

By triangle inequality

||y − x ||2 ≤ ||yf ∗ −a||2 +||y−f ∗ − x−f ∗ ||2≤ 2

pε|a|+p

ε|a|= 3||x − x ′||2.

Thus, with probability ≥ 2/3 our algorithm satisfies `2/`2guarantee with C = 3.

61 / 73

Page 93: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Runtime=O(logn loglogn)

Sample complexity=O(logn loglogn)

Ex. 1: reduce sample complexity to O(logn), keepO(poly(logn)) runtime

Ex. 2: reduce sample complexity to O(log1/εn)

What about k > 1

62 / 73

Page 94: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Runtime=O(logn loglogn)

Sample complexity=O(logn loglogn)

Ex. 1: reduce sample complexity to O(logn), keepO(poly(logn)) runtime

Ex. 2: reduce sample complexity to O(log1/εn)

What about k > 1

62 / 73

Page 95: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Runtime=O(logn loglogn)

Sample complexity=O(logn loglogn)

Ex. 1: reduce sample complexity to O(logn), keepO(poly(logn)) runtime

Ex. 2: reduce sample complexity to O(log1/εn)

What about k > 1

62 / 73

Page 96: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Outline

1. Sparsity: definitions, motivation

2. Computing Fourier transform of 1-sparse signals fast

3. Sparsity k > 1: main ideas and challenges

63 / 73

Page 97: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparsity k > 1Let x ′ ← best k -sparse approximation of x

Our goal: find y such that

||x − y ||2 ≤C · ||x − x ′||2where C > 1 is the approximation factor.

(This is the `2/`2 guarantee)

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

head

64 / 73

Page 98: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Sparsity k > 1

Main idea: implement hashing to reduce to 1-sparse case:

Ï ‘hash’ frequencies into ≈ k bins

Ï run 1-sparse algo on isolated elements

Assumption: can randomly permute frequencies (will remove innext lecture)

Implement hashing? Need to design a bucketing scheme forthe frequency domain

65 / 73

Page 99: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

66 / 73

Page 100: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

67 / 73

Page 101: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

67 / 73

Page 102: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

68 / 73

Page 103: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

69 / 73

Page 104: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

69 / 73

Page 105: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

69 / 73

Page 106: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

69 / 73

Page 107: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

69 / 73

Page 108: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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!

69 / 73

Page 109: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Zero-th bucket signal u0:

u0f =

xf , if f ∈ [− n

2B : n2B

]0 o.w.

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

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

u0a =∑

fu0

f ·ωf ·a = ∑− n

2B ≤f≤ n2B

xf ·ωf ·a = ∑− n

2B ≤f≤ n2B

yf ,

where yj = xj+a

70 / 73

Page 110: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Zero-th bucket signal u0:

u0f =

xf , if f ∈ [− n

2B : n2B

]0 o.w.

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

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

u0a =∑

fu0

f ·ωf ·a

= ∑− n

2B ≤f≤ n2B

xf ·ωf ·a = ∑− n

2B ≤f≤ n2B

yf ,

where yj = xj+a

70 / 73

Page 111: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Zero-th bucket signal u0:

u0f =

xf , if f ∈ [− n

2B : n2B

]0 o.w.

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

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

u0a =∑

fu0

f ·ωf ·a = ∑− n

2B ≤f≤ n2B

xf ·ωf ·a

= ∑− n

2B ≤f≤ n2B

yf ,

where yj = xj+a (y is a time shift of x by the time shift theorem).

70 / 73

Page 112: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Zero-th bucket signal u0:

u0f =

xf , if f ∈ [− n

2B : n2B

]0 o.w.

-0.5

0

0.5

1

-1000 -500 0 500 1000

frequency

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

u0a =∑

fu0

f ·ωf ·a = ∑− n

2B ≤f≤ n2B

xf ·ωf ·a = ∑− n

2B ≤f≤ n2B

yf ,

where yj = xj+a (y is a time shift of x by the time shift theorem).

70 / 73

Page 113: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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

u0a = ∑

− n2B ≤f≤ n

2B

yf ,

where yj = xj+a (y is a time shift of x).

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Then

u0a = ∑

− n2B ≤f≤ n

2B

yf

= ∑f∈[n]

yf Gf = (y ∗ G)(0)= (x·+a ∗ G)(0)

71 / 73

Page 114: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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

u0a = ∑

− n2B ≤f≤ n

2B

yf ,

where yj = xj+a (y is a time shift of x).

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Then

u0a = ∑

− n2B ≤f≤ n

2B

yf

= ∑f∈[n]

yf Gf = (y ∗ G)(0)= (x·+a ∗ G)(0)

71 / 73

Page 115: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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

u0a = ∑

− n2B ≤f≤ n

2B

yf ,

where yj = xj+a (y is a time shift of x).

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Then

u0a = ∑

− n2B ≤f≤ n

2B

yf =∑

f∈[n]yf Gf

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

71 / 73

Page 116: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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

u0a = ∑

− n2B ≤f≤ n

2B

yf ,

where yj = xj+a (y is a time shift of x).

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Then

u0a = ∑

− n2B ≤f≤ n

2B

yf =∑

f∈[n]yf Gf = (y ∗ G)(0)

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

71 / 73

Page 117: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

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

u0a = ∑

− n2B ≤f≤ n

2B

yf ,

where yj = xj+a (y is a time shift of x).

Let

Gf =

1, if f ∈ [− n2B : n

2B]

0 o.w.

Then

u0a = ∑

− n2B ≤f≤ n

2B

yf =∑

f∈[n]yf Gf = (y ∗ G)(0)= (x·+a ∗ G)(0)

71 / 73

Page 118: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Need to evaluate(x ∗ G)

(j · n

B

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

We have access to x , not x ...

By the convolution identity

x ∗ G = à(x ·G)

Suffices to compute

x ·Gj · nB

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

72 / 73

Page 119: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Need to evaluate(x ∗ G)

(j · n

B

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

We have access to x , not x ...

By the convolution identity

x ∗ G = à(x ·G)

Suffices to compute

x ·Gj · nB

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

72 / 73

Page 120: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Need to evaluate(x ∗ G)

(j · n

B

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

We have access to x , not x ...

By the convolution identity

x ∗ G = à(x ·G)

Suffices to compute

x ·Gj · nB

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

72 / 73

Page 121: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Suffices to compute

x ·Gj · nB

, j =−B/2, . . . ,B/2−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!

72 / 73

Page 122: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Suffices to compute

x ·Gj · nB

, j =−B/2, . . . ,B/2−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!

72 / 73

Page 123: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Suffices to compute

x ·Gj · nB

, j =−B/2, . . . ,B/2−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!

72 / 73

Page 124: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Suffices to compute

x ·Gj · nB

, j =−B/2, . . . ,B/2−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!

Design a filter supp(G)≈ k? Truncate sinc? Tolerate imprecisehashing? Collisions in buckets?

73 / 73

Page 125: Алгоритмы быстрого вычисления разреженного преобразования Фурье (Sparse FFT), осень 2015: Сигналы с разреженным

Suffices to compute

x ·Gj · nB

, j =−B/2, . . . ,B/2−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!

Design a filter supp(G)≈ k? Truncate sinc? Tolerate imprecisehashing? Collisions in buckets?

73 / 73