A little tutorial on using Fourier transforms

Published

January 10, 2024

This is a small tutorial on using the Fourier transform, written mostly as a cheat sheet for myself.

1. What is the Fourier transform?

Given a signal \(x(t)\), the Fourier transform breaks down the signal into its constituent trigonometric functions as a convergent series.

Mathematically, any Lipschitz continuous periodic \(x(t)\) on \([0, 2 \pi]\) can be written as a complex sum (appealing to the Euler form of complex numbers): \[ x(t) = \sum_{k = -\infty}^\infty c_k \exp(ikt) \] where \[ c_k = \frac{1}{2\pi} \int_{0}^{2\pi} x(t) \exp(-ikt)dt \,.\] Use the symmetries of the sine and cosine to obtain \[ x(t) = \sum_{k = 0}^{\infty} a_k \cos(kt) + \sum_{k = 1}^\infty b_k \sin(kt)\] here, \(a_0 = c_0\) and \[ a_k = \frac{1}{\pi} \int_{0}^{2\pi} x(t) \cos(kt) dt \quad \text{ and } \quad b_k = \frac{1}{\pi} \int_{0}^{2\pi} x(t) \sin(kt) dt \, .\] Recover the coefficients as \[ c_{\pm k} = \frac{a_k}{2} \pm \frac{b_k}{2i} \,.\]

2. Pythonic Implementation