Phase 01: Math Foundations

The Fourier Transform

Every signal is a sum of sine waves. The Fourier transform tells you which ones. Language: Python Implement the DFT from scratch and verify it against the O(N log N) Cooley-Tukey FFT. Interpret frequency coefficients: extract amplitude, phase, and power spectrum from a signal. Apply the convolution theorem to perform convolution via FFT multiplication. Connect Fourier frequency decomposition to transformer positional encodings and CNN convolution layers. An audio recording is a sequence of pressure measurements over time. A stock price is a sequence of values over days. An image is a grid of pixel intensities over space. All of these are data in the time domain (or space domain). You see values changing over some index. But many patterns are invisible in the time domain. Is this audio signal a pure tone or a chord? Does this stock price have a weekly cycle? Does this image have a repeating texture? These questions are about frequency content, and the time domain hides it. The Fourier transform converts data from the time domain to the frequency domain. It takes a signal and decomposes it into sine waves of different frequencies. Each sine wave has an amplitude (how strong it is) and a phase (where it starts). The Fourier transform tells you both. This matters for ML because frequency-domain thinking appears everywhere. Convolutional…

The Fourier Transform: Every signal is a sum of sine waves. The Fourier transform tells you which ones. Language: Python Implement the DFT from scratch and…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.