For today you should:
1) Exercises
2) Case study
Today:
1) Smoothing
2) Filtering and convolution
For next time:
1) Exercises
2) Case study
Last progress report on Dec 5.
Case study due during our nominal final period, Monday 15 December, officially 12-3, actually 1-3pm. Poster session for Bayesian or DSP or both.
Wave uses scipy.fftpack.rfft, which takes a vector of N reals and returns a vector of N/2 complex.
That makes sense for working with real signals, but it is asymmetric.
scipy.fftpack.fft computes the true DFT, which maps from a vector of N complex to a vector of N complex.
What happens if we compute the true DFT of a real signal? If we really only have N pieces of information, we can't get N complex numbers.
See chap08.ipynb
Gaussian smoothing (also known as Gaussian blur) is a way of smoothing a signal by computing a local weighted average.
This operation can be described in terms of windows, signals, and convolution.
From Wikipedia:
Which brings us (at last) to the Convolution theorem:
In mathematical language:
and
In the language of signal processing: convolving a signal with a window has the effect of applying a filter to the frequency components.
Why, you ask?
1) You can write convolution in the form of matrix multiplication.
2) The eigenfunctions of the matrix are complex exponentials.
3) Therefore you can decompose a signal into a sum of complex exponentials, figure out the effect on each components, and then add the components back up.
Exercise: scipy.signal provides a passel of window functions. Try out one of the others and see what effect it has on the square wave. Also try playing around with the parameters.
There are a lot of windows that compute something like a weighted local average. All of them have the effect of smoothing / low pass filtering.
What about numerical differentiation, of which the simplest form is diff()?
What about integration? We've used numpy.cumsum and scipy.integrate.cumtrapz. At first look, they don't seem like convolutions. But we've seen that they behave like filters. So they must be convolutions!
Let's figure out what their window is.
Exercise: What effect does scipy.signal.medfilt have in the frequency domain?