For today you should:
1) Exercises
2) Case study
Today:
1) Convolution theorem redux
2) Fourier analysis of images
2) Image processing tutorial
For next time:
1) Exercises (see links and suggestions below)
2) Case study
3) Last progress report
DFT(f*g) = DFT(f) DFT(g)
Which provides an efficient process for computing convolution.
Convolution process
1) Shift the window
2) Compute a sum of products
3) Repeat
Or mathematically
One detail I omitted last time: convolution flips one of the functions. From Wikipedia:
The other part of the convolution theorem we didn't discuss: how does it work?
The answer, as is so often the case, starts with "eigen".
Computing a discrete convolution is equivalent to multiplication by a matrix where each row is a shifted version of the window.
The eigenvectors of that matrix are (wait for it) the complex exponentials.
So in linear-algebra-speak, the DFT is a transform matrix; that is, it takes a vector from one basis (the standard basis) to another (the complex exponentials).
For each complex exponential, we can compute the convolution by multiplication (because it is an eigenvector).
How do we know the eigenvalue for each of these eigenvectors? By computing the DFT of the window, g.
Then we transform back to the standard basis.
Quoth Wikipedia:
"If one sequence is much longer than the other, zero-extension of the shorter sequence and fast circular convolution is not the most computationally efficient method available. Instead, decomposing the longer sequence into blocks and convolving each block allows for faster algorithms such as the Overlap–save method and Overlap–add method."
Exercise: Implement the overlap-save method
Based on this tutorial
git clone https://github.com/AllenDowney/skimage-tutorials.git
cd skimage-tutorials/
ipython notebook
Select lectures/00_images_are_arrays.ipynb
Read and do the letter-H exercise.
In your ThinkDSP repo, pull from upstream and load chap09.ipynb
Thesis: For any topic, there is a relevant xkcd
Correlary: Sometimes you have to go deep into the archive!