Don’t forget the Unit 2 debrief form! Due by end of Friday
I’m gone for the rest of the week. Reach out to me over email or
Discord if you have questions
Recall
Measuring periodicity for noisy data can be very sensitive to
initial guesses
Any periodic signal can be represented as a combination of sine
waves
The Fourier transform wraps a signal at different periods and
measures the “overlap” of that signal at each period
Moves a signal from “time-space” to “frequency-space”
The signal’s power spectrum is the square of the amplitude of its
Fourier transform
Can use fft (or
rfft) to compute the power-spectrum, and
fftfreq (or
rfftfreq) to compute the corresponding
frequencies
Today’s Plan
Going from frequency-space to time-space
Understanding discrete data’s effect on the Fourier Transform
Quiz
Back it up
The Inverse FFT
You can also go backwards!
The Inverse Fourier Transform moves you back from the
frequency-domain to the time-domain
In Python, this is given by ifft
In R, use the inverse = TRUE flag inside
fft
Make it possible to filter out certain frequencies, and then
transform back to a clean signal
Activity!
I’ve generated noisy data of a single oscillation here.
Your task is to determine the period/frequency, filter out
everything else by setting it to 0, and then transform that signal back
and plot it atop the original noise
Discrete Effects
Common Transforms
Important Fourier Transform
Pairs
Convolutions
Mathematically, a convolution is defined as: \[ [f * g](t) = \int_{-\infty}^{\infty}
f(t)g(t-\tau)\,d\tau \]
Conceptually, this is the same as:
Taking the second function and flipping it about the y-axis
Then “sliding” that function across the other, from left to
right
Each step, summing the area beneath both functions
Fourier Transforms have a particular attribute: \[ \mathcal{F}\{f * g\} = \mathcal{F}\{f\} \cdot
\mathcal{F}\{g\} \] or \[
\mathcal{F}\{f \cdot g\} = \mathcal{F}\{f\} * \mathcal{F}\{g\}
\]
In other words: convolutions in one space are the same as just
multiplying the function point-wise in the other space
Example 1: Window
Example 2: Discrete Measurements
Our Powers Combined…
In practice, most real world data consists of both effects:
Data was measured over some duration: the window
Will cause broadening of our peaks. The narrower the window, the
greater the broadening.
Data was collected at some frequency: the discrete measurements
Will cause aliases of the signal, spaced according to the
sampling rate
The slower the sampling rate, the more densely packed the
aliases
The Nyquist Limit
Note that if the window of observations gets too small, or the time
between observations too large, our Fourier Transform peaks will begin
to overlap!
In this case not all of the frequency information can be
recovered
This is called the Nyquist Limit, and occurs at a frequency of half
the sampling frequency
The FFT algorithm generally measures frequencies up to but
not beyond this point, so you shouldn’t see aliases in your results, but
your results might not capture what you were hoping to see.
Nyquist Visual
Quiz 1
Quiz Time!
Put your notes away and have just a writing implement and a
calculator out!
Show as much work or your thought process as you can on all problems
for the potential of partial credit