The Fourier Transform: From Time to Frequency
Imagine a piano chord. You hear a single sound, but in reality, it is a sum of several individual notes sounding simultaneously. The Fourier transform does exactly that with any signal — it takes something complex and "untangles" which simple oscillations (sinusoids) compose it and how strongly each one is present.
That is the whole idea. Everything else in this article is simply about how to write down and compute this "untangling".
There are two ways to look at a signal:
- Time domain — the signal as a sequence of values changing over time (the way it appears on an oscilloscope).
- Frequency domain — the same signal, but described by which frequencies are present and with what strength.
The Fourier transform is the bridge between these two perspectives.
The Continuous Fourier Transform
The continuous Fourier transform is defined as:
$X(f) = \int_{-\infty}^{\infty} x(t) e^{-j2\pi ft} dt$
Do not be alarmed by the complex exponential $e^{-j2\pi ft}$ — it is simply a compact way to describe both sine and cosine simultaneously (via Euler's identity). The idea behind the formula is simple: for every possible frequency $f$, it checks "how well does the signal match a pure sinusoid at this frequency?" The result $X(f)$ tells us two things:
- Magnitude $|X(f)|$ — how strongly this frequency is present.
- Phase $\angle X(f)$ — how the component is shifted in time.
The inverse Fourier transform recovers the original signal from its spectrum:
$x(t) = \int_{-\infty}^{\infty} X(f) e^{j2\pi ft} df$
In practice, however, computers do not work with continuous time and infinite precision. Before any computation, the signal must go through two steps:
- Sampling — taking measurements of the signal at regular intervals (e.g., 44,100 times per second for audio).
- Quantisation — rounding each sampled value to the nearest level from a finite set (e.g., 65,536 levels for 16‑bit recording).
Both steps exist for a simple reason: digital systems can only store finite numbers, not infinite precision.
The Discrete Fourier Transform (DFT)
It is worth clarifying what discrete actually means. A discrete signal is one that is defined only at specific instants in time — typically at equally spaced intervals. This is the result of sampling, the process of taking measurements of a continuous signal at regular intervals (every $T$ seconds).
Sampling is not the only step. In a digital system, the sampled values must also be represented as numbers with finite precision. This is called quantisation — the process of mapping each continuous amplitude value to a discrete level from a finite set. The number of available levels depends on the bit depth of the system (e.g., 8‑bit gives 256 levels, 16‑bit gives 65,536 levels).
Both sampling and quantisation are necessary because digital processors cannot handle continuous time or infinite precision. They can only operate on finite sequences of numbers.
Sampling
Continuous signal (blue) and sampled points (red)
Quantisation
Sampled points (red) and quantised levels (gray)
The figure above illustrates the two key steps in converting a continuous signal into a digital representation. The left plot shows the continuous signal (blue) and the discrete samples taken at regular intervals (red). The right plot shows the sampled points (red) and the quantised values (green) after rounding to the nearest available level. The quantisation levels are shown as faint dashed lines.
After sampling and quantisation, we obtain a signal represented as a finite list of numbers: $x[0], x[1], ..., x[N-1]$. This is exactly the list that the Discrete Fourier Transform (DFT) processes.
For a discrete signal $x[n]$ of length $N$, where $n$ is the sample index $(n = 0, 1, ..., N-1)$, the DFT is defined as:
$X[k] = \sum_{n=0}^{N-1} x[n] \cdot e^{-j \frac{2\pi}{N} k n}$
The DFT transforms N time-domain samples into N frequency-domain bins. Each bin $k$ corresponds to a specific frequency:
$f_k = \frac{k \cdot f_s}{N}$
where $f_s$ is the sampling frequency. The first bin ($k = 0$) represents DC — the average value of the signal. The bin at $k = N/2$ represents the Nyquist frequency — the highest frequency that can be represented without aliasing.
An important point about the DFT is that it assumes the signal is periodic — the finite segment of length $N$ is treated as one period of an infinitely repeating sequence. If the signal is not periodic within the analysis window, spectral leakage occurs. This is precisely why window functions are needed.
The DFT is a linear transform, which means superposition holds: the transform of a sum of signals is the sum of their transforms. This property is what makes frequency-domain filtering possible.
A Concrete Example: Computing One DFT Coefficient
Let us immediately see what the DFT does in practice. Consider the signal $x[n] = [1, 0, -1, 0]$ (four numbers, $N = 4$). We want to compute $X[2]$.
Substitute $k = 2$ into the DFT formula:
$X[2] = \sum_{n=0}^{3} x[n] \cdot e^{-j \pi n}$
because $\frac{2\pi}{4} \cdot 2 = \pi$.
Expanding the sum:
$X[2] = 1 \cdot e^{0} + 0 \cdot e^{-j\pi} + (-1) \cdot e^{-j2\pi} + 0 \cdot e^{-j3\pi}$
Using Euler's identity, $e^{-j\pi n}$ gives values $1, -1, 1, -1$ for $n = 0, 1, 2, 3$ respectively. Thus:
$X[2] = 1 \cdot 1 + 0 \cdot (-1) + (-1) \cdot 1 + 0 \cdot (-1) = 0$
Therefore, $X[2] = 0$ — the signal has no energy at the frequency corresponding to $k = 2$ (the Nyquist frequency). This makes sense: the signal $[1, 0, -1, 0]$ repeats every two samples, not every four, so it does not match that frequency component.
With this example in mind, the remaining concepts become easier to absorb.