Discrete Fourier

Jed Rembold

February 18, 2026

Announcements

  • HW5 is due on Monday
  • 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

Visual Convolutions

https://commons.wikimedia.org/wiki/File:Convolution_of_box_signal_with_itself2.gif

Why do we care?

  • 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

2023-02-22T00:19:52.628909 image/svg+xml Matplotlib v3.6.2, https://matplotlib.org/ FT FT FT Pointwise product Convolution

Example 2: Discrete Measurements

2023-02-22T00:33:03.244714 image/svg+xml Matplotlib v3.6.2, https://matplotlib.org/ FT FT FT Pointwise product Convolution

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

2023-02-22T14:01:11.184865 image/svg+xml Matplotlib v3.6.3, https://matplotlib.org/ FT FT FT Pointwise product Convolution

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
  • When you are finished you can leave
// reveal.js plugins // Added plugins ,