Fourier Series
A Fourier series writes any periodic function as a sum of sines and cosines. Joseph Fourier introduced the technique in 1822 to solve the heat equation, and the idea proved so general that Fourier series and their continuous cousin, the Fourier transform, now sit at the heart of signal processing, quantum mechanics, image compression, audio synthesis, and pure mathematics. The principle is simple: complex periodic patterns are made of simple sinusoidal harmonics — and knowing the harmonics is knowing the pattern.

The Series
For a function \( f(x) \) that’s periodic with period \( 2\pi \), the Fourier series is:
$$ f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} \left[a_n \cos(nx) + b_n \sin(nx)\right] $$
The Fourier coefficients \( a_n, b_n \) are computed by integrating \( f \) against the corresponding sine and cosine:
$$ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(nx)\, dx, \quad b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin(nx)\, dx $$
These formulas extract the ‘amount’ of each harmonic frequency in \( f \). For a function with period \( T \) other than \( 2\pi \), replace \( nx \) with \( 2\pi n x / T \).
Complex Form
Using Euler’s formula, the series condenses into a single sum of complex exponentials:
$$ f(x) = \sum_{n=-\infty}^{\infty} c_n e^{in x}, \quad c_n = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x) e^{-inx}\, dx $$
This compact form is preferred in physics and engineering, especially when extending to the Fourier transform of non-periodic functions.
Why It Works: Orthogonality
The sines and cosines are orthogonal functions over any full period: \( \int_{-\pi}^{\pi} \sin(mx) \cos(nx)\, dx = 0 \) for all \( m, n \), and \( \int \sin(mx) \sin(nx)\, dx = 0 \) for \( m \neq n \). Orthogonality is what lets the integral formulas above extract one harmonic at a time. It’s exactly analogous to projecting a vector onto orthogonal basis vectors — Fourier coefficients are inner products with the harmonic basis.
Convergence and the Gibbs Phenomenon
Truncating the series at \( N \) terms gives an approximation that’s exact in the limit \( N \to \infty \) for piecewise-smooth functions. Near jump discontinuities (e.g., the edges of a square wave), the truncated series overshoots the target by about 9% — the Gibbs phenomenon. Adding more terms makes the overshoot narrower in width but doesn’t reduce its height. It’s a fundamental feature, not a bug, of representing discontinuities with smooth functions.
Worked Example: Square Wave
The square wave that equals +1 on \( (0, \pi) \) and -1 on \( (-\pi, 0) \) has Fourier coefficients:
$$ b_n = \frac{4}{n\pi} \text{ if } n \text{ is odd}, \quad b_n = 0 \text{ if } n \text{ is even}, \quad a_n = 0 $$
So the series is \( f(x) = \tfrac{4}{\pi}\big[\sin x + \tfrac{1}{3}\sin 3x + \tfrac{1}{5}\sin 5x + \cdots\big] \). Only odd harmonics appear, with amplitudes that fall off like \( 1/n \). This is why a square wave ‘sounds harsh’ compared to a sine wave: it carries a lot of energy at odd harmonics.
From Series to Transform
For non-periodic functions, the discrete Fourier coefficients become a continuous function: the Fourier transform:
$$ \hat{f}(\omega) = \int_{-\infty}^{\infty} f(x) e^{-i\omega x}\, dx $$
Discrete versions of this (DFT, FFT) run on every spectrum analyzer, audio app, and image-processing pipeline in the world.
Applications
- Audio. Every digital audio signal can be decomposed into its spectrum. EQ, pitch shifting, noise reduction, vocal tuning, and MP3 compression all work in the frequency domain.
- Image compression. JPEG uses the discrete cosine transform (a Fourier cousin) on 8×8 blocks. High-frequency coefficients carry less perceptually important information and are aggressively quantized to save space.
- Quantum mechanics. A particle’s wave function in position space and its wave function in momentum space are Fourier transforms of each other. The Heisenberg uncertainty principle is a direct consequence of this Fourier duality.
- Heat and wave equations. Fourier introduced the series specifically to solve the heat equation, by separating spatial and temporal parts.
- NMR and MRI. Medical imaging hardware measures Fourier-transformed signals and inverts them to reconstruct images.
- Communications. OFDM (used in Wi-Fi, 4G/5G, DSL) and most modern modulation schemes encode data on the amplitudes and phases of carefully chosen Fourier components.
Related study notes: Euler’s Identity, Imaginary Numbers, Partial Derivatives, Differential Equations.
Frequently Asked Questions
What is a Fourier series?
A way of writing any reasonably nice periodic function as an infinite sum of sines and cosines (or equivalently, complex exponentials). The coefficients of each term tell you how much of that specific harmonic frequency the function contains. Introduced by Joseph Fourier in 1822.
Why are sines and cosines a natural basis?
Because they’re orthogonal over one period — the integral of sin(mx)·cos(nx) over a full period is zero, and similar for distinct harmonics. Orthogonality lets you ‘extract’ the amount of each harmonic by a simple integral, exactly as you’d project a vector onto each axis of an orthogonal coordinate system.
What is the Gibbs phenomenon?
Near a jump discontinuity, the partial sums of a Fourier series overshoot the target by about 9% no matter how many terms you add. This is the Gibbs phenomenon. More terms narrow the overshoot in width but don’t reduce its height. It’s an unavoidable feature of approximating discontinuities with smooth functions.
What’s the difference between Fourier series and Fourier transform?
Fourier series decompose periodic functions into discrete harmonics (integer multiples of a fundamental frequency). The Fourier transform decomposes non-periodic functions into a continuous spectrum of frequencies. The transform is the limit of the series as the period goes to infinity.
How does MP3 compression use Fourier analysis?
An MP3 encoder breaks audio into short frames, applies a Fourier-like transform (modified discrete cosine transform, MDCT), and identifies which frequency components are masked by louder nearby components — meaning the human ear won’t hear them. Those components are quantized aggressively or thrown away, shrinking the file while keeping perceived quality high.
Why does the Heisenberg uncertainty principle look like a Fourier statement?
Because it is one. In quantum mechanics, a particle’s position-space wave function and its momentum-space wave function are Fourier transforms of each other. A general property of Fourier pairs: making one function narrow makes its transform broad, and vice versa. The uncertainty principle Δx · Δp ≥ ℏ/2 is the mathematical Fourier inequality applied to wave functions.