Building a square wave out of pure sines
Hand someone a sine wave and a square wave and they look like different species — one is impossibly smooth, the other all corners and flat tops. Yet Fourier's claim is that the square wave is made of sine waves, the way white light is made of colours. Take a sine at the square wave's own frequency (the fundamental), add a smaller one at three times the frequency (the third harmonic), then a still-smaller one at five times, then seven, nine... Keep going and the wobbly sum visibly stiffens into flat shelves with sharp edges. The corners you thought were the opposite of a sine are just what a great many sines, stacked in the right amounts, conspire to produce.
Square wave (period T, frequency f0 = 1/T) as a sum of odd harmonics:
x(t) = (4/π) · [ sin(ω0 t) + (1/3)sin(3ω0 t) + (1/5)sin(5ω0 t)
+ (1/7)sin(7ω0 t) + ... ] ω0 = 2π f0
1 term 3 terms many terms
_ ___ _________
/ \ +1 -> / \ -> | | <- flat shelf
/ \ / \ | |
------------ 0 ---/-------\--- ___| |___ 0
\ / \ / | |
\_/ \___/ |_________| <- sharp edge
only ODD harmonics (1,3,5,7...), amplitudes falling off as 1/nThis is the [[ee-fourier-series|Fourier series]]: any reasonable periodic signal equals a sum of sinusoids whose frequencies are integer multiples of one fundamental frequency f₀. Each harmonic gets its own amplitude and phase — a recipe of how much of each pure tone to pour in. Why only integer multiples? Because only those frequencies fit a whole number of cycles inside one period and so repeat with the signal; anything else would drift and break periodicity. The square wave's recipe happens to use only odd harmonics (a consequence of its half-wave symmetry), but a general periodic signal — a guitar note, an engine vibration, a heartbeat trace — uses whatever blend its shape demands.
Gibbs ripple: the overshoot that never goes away
Stack up the square wave's harmonics and something stubborn happens near every jump. Right at the sharp edge the partial sum doesn't settle neatly onto the flat top — it shoots past it, overshooting by about 9 % of the jump height, then rings as it relaxes. Add more harmonics and the ripple gets narrower, hugging closer to the edge, but it never gets shorter: that 9 % overshoot is permanent. This is the Gibbs phenomenon, and it is not a bug in your maths — it is a fundamental tension between perfectly smooth sines and a perfectly sharp discontinuity.
Gibbs overshoot at a step edge (N = number of harmonics):
9% overshoot (independent of N!)
v
_∩_______________ ideal level +1
/
/ ripple gets NARROWER as N grows,
/ but the peak stays ~9% above the step
___/
|
___|________________________ ideal level 0
\ ∪ <- 9% undershoot below
N=10 : fat, slow ripple, ~9% peak
N=100 : thin, fast ripple, still ~9% peak
N=inf : ripple width -> 0, peak STILL ~9% at the instant of the jumpFrom periodic to everything: the Fourier transform
The Fourier series is gorgeous but it only handles periodic signals — things that repeat forever. Real life is full of one-shot events: a single hand-clap, a lightning strike on a power line, a packet of data, a camera flash. These are [[ee-signal-classification|aperiodic]] signals, and the trick to reach them is a thought experiment. Take a periodic signal and slowly stretch its period T toward infinity. As the period grows, the gap between neighbouring harmonics — which sits at the fundamental spacing f₀ = 1/T — shrinks toward zero. The discrete comb of harmonics fills in, line by line, until it becomes a smooth, continuous spectrum.
Stretching the period turns a discrete series into a continuous transform: Periodic, T finite Aperiodic, T -> infinity ------------------- ------------------------ | | | | | | | ||||||||||||||||||||||| | | | | | | | -----> a smooth filled-in curve ------------------- ------------------------ spacing f0 = 1/T spacing -> 0 (continuum) Fourier SERIES (sum) Fourier TRANSFORM (integral) Forward: X(f) = ∫ x(t) e^(-j2πft) dt 'how much of frequency f?' Inverse: x(t) = ∫ X(f) e^(+j2πft) df rebuild signal from spectrum The e^(-j2πft) factor is a 'probe sinusoid' you slide x(t) against; the integral measures how strongly x(t) correlates with that frequency.
The result is the [[ee-fourier-transform|Fourier transform]] X(f): instead of a list of harmonic amplitudes, you get a continuous function telling you 'how much' of every frequency f is present in x(t). The forward transform is an integral that slides a probe sinusoid e^(−j2πft) against your signal and measures how strongly they correlate; the inverse transform stitches all those frequency components back into the original time-domain wave. Series and transform are the same idea — decompose a signal into sinusoids — viewed at two scales. Periodic signals get a sparse line spectrum; aperiodic signals get a dense continuous one.
Magnitude, phase, and the time–frequency duality
The transform X(f) is complex, so it carries two real pieces of information at every frequency. Its magnitude |X(f)| is the magnitude spectrum — how much of each frequency is present, the loudness of each tone. Its angle ∠X(f) is the phase spectrum — when each tone starts, its timing offset. Beginners obsess over magnitude and ignore phase, but phase is where the structure lives: scramble a photo's phase spectrum while keeping its magnitude and the image dissolves into noise; keep the phase but flatten the magnitude and you can often still recognise the picture. Phase says *where things are*; magnitude says *how strong they are*.
Now the deepest pattern in all of Fourier analysis — the time–frequency duality. A signal that is narrow in time is wide in frequency, and vice versa. A sharp, fleeting click — almost an instant in time — needs an enormous spread of frequencies to build that suddenness, so its spectrum is broad and flat. A long, lazy, pure tone — spread out over time — lives at essentially one frequency, so its spectrum is a single thin spike. Squeeze a signal in one domain and it inevitably bulges in the other, like air in a balloon.
Time domain Frequency domain (magnitude)
-------------------------- -----------------------------
Narrow click (impulse-like) Wide, nearly flat spectrum
| ___________________
| | |
---+---------------- t ---+-------------------- f
(instant) (all frequencies)
Long pure tone (sine) Single sharp spike
/\ /\ /\ /\ |
/ \/ \/ \/ \ t --------+--------------- f
(one frequency f0)
RULE: Δt · Δf >= constant (narrow in one => wide in the other)
Same maths as Heisenberg's uncertainty principle in quantum mechanics.The payoff: why convolution becomes multiplication
Here is the reason the whole frequency-domain detour is worth taking, and it reaches back to the previous rung. Recall that an [[ee-convolution|LTI system]] — an amplifier, a cable, a room's acoustics — turns its input into output by convolution with the impulse response: a flip-slide-multiply-sum operation that is a genuine grind to compute. The miracle is what happens when you feed such a system a single pure sinusoid: out comes the same sinusoid, at the same frequency, only its amplitude scaled and its phase shifted. The shape is untouched. The system cannot create new frequencies; it can only turn each existing one up or down and slide it in time.
That property has a precise mathematical name: sinusoids (or their complex form e^(j2πft)) are the eigenfunctions of LTI systems. An eigenfunction is an input whose *shape* survives the system untouched — only a scaling number, the eigenvalue, changes. So if you first decompose any input into sinusoids with the Fourier transform, each one passes through the system independently, merely multiplied by its own complex gain. Stitch the outputs back together and you have the full response — with no convolution sum anywhere in sight.
The convolution theorem — the single most useful identity in DSP:
TIME DOMAIN FREQUENCY DOMAIN
---------------- ------------------------
y(t) = x(t) * h(t) <-> Y(f) = X(f) · H(f)
^^^ ^^^
convolution multiplication
(flip-slide-sum, (one complex multiply
O(N^2) work) per frequency, easy)
H(f) = the system's FREQUENCY RESPONSE
= Fourier transform of the impulse response h(t)
So the recipe to run a signal through an LTI system:
1. X = FFT(x) take the input to the frequency domain
2. Y = X * H multiply, point by point, by H(f)
3. y = IFFT(Y) transform back to the time domain
This is exactly how a graphic EQ, a reverb plug-in, and a
digital radio channel filter actually run.This is the convolution theorem, and it is the punchline of the whole rung: *convolution in time equals multiplication in frequency*. The complex gain a system applies at each frequency, gathered into one function H(f), is the [[ee-frequency-response|frequency response]] — and it is simply the Fourier transform of the impulse response you met last rung. Knowing H(f) you can predict what the system does to *any* input at a glance: where it boosts, where it cuts, where it delays. That is precisely the subject of the next rung, where H(f) becomes the central character and Bode plots let you read a system's whole behaviour off a single graph.
The big picture on one page
Step back and the move you just made is the same one as the phasor: leave the awkward domain, do easy work, come back. The phasor handled one frequency; Fourier handles all of them at once. Everything follows from a single decomposition.
- Decompose. Any signal is a sum (periodic → Fourier series) or integral (aperiodic → Fourier transform) of pure sinusoids.
- Read the spectrum as two parts: magnitude |X(f)| (how much of each frequency) and phase ∠X(f) (the timing of each).
- Mind the duality: narrow in time ↔ wide in frequency. Bandwidth and timing are two faces of one coin.
- Exploit eigenfunctions: each sinusoid passes through an LTI system scaled and shifted, never reshaped.
- Cash in the convolution theorem: replace convolution with X(f)·H(f), then inverse-transform back to time.