Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Fourier transform and convolution

The puzzle: what frequency is a hand-clap?

A whistle has a pitch. Ask anyone to hum it back and they can. A hand-clap has no pitch at all — nobody has ever hummed a clap — and yet a microphone and an FFT will report that the clap contains energy at every frequency from a few hertz to well past the top of your hearing.

That should be uncomfortable. Module 03 was built entirely on periodicity: a signal repeats with period TT, and only the harmonics of 2π/T2\pi/T are allowed. A clap never repeats. There is no TT, so there are no harmonics, so there is no comb — and yet the spectrum is not empty. It is fuller than any musical note’s.

The second version of the puzzle is sitting in the air around you. Hundreds of radio stations broadcast simultaneously into the same volume of space, and the total field at your antenna is a single messy voltage against time. Somehow a receiver pulls one station out of that. Whatever lets it do so is what this module builds.

Predict before you calculate

Commit to an answer for each of these before running anything. Write them down.

  1. A pulse is made half as long, keeping its shape. Its spectrum becomes wider, narrower, or stays the same — and by what factor?

  2. Two recordings have identical magnitude spectra, ∣F(ω)∣|F(\omega)| the same at every frequency. Must they be the same signal? If not, how different can they be?

  3. A 60 Hz sine wave is sampled 100 times a second. What frequency does the recorded data appear to show, and is there anything in the data that warns you?

  4. Is there a signal that is both very short in time and very narrow in frequency? If not, is that a limitation of our instruments or something stronger?

Explore the model

The laboratory gives you a pulse sculptor: choose a shape, set its width, add a chirp, and watch the signal and its spectrum side by side with the analytic pair drawn over the numerics. A sampling control lets you make the grid too coarse on purpose, and a live meter reports ΔtrmsΔωrms\Delta t_{\text{rms}} \Delta\omega_{\text{rms}} against the floor it is not allowed to cross.

A Gaussian pulse squeezed in time while its spectrum widens by exactly the reciprocal factor. The shaded bands are the RMS widths in each domain, and the gauge along the top carries their product against the line at 12\tfrac12. Both panels keep fixed axes throughout: if either rescaled itself, narrowing in time would stop looking like widening in frequency. The marker never leaves the line, in either direction of the sweep — that is the theorem, not an illustration of it.

A wheel filmed by a strobe. The true rotation rate ramps up from rest; the strobed marker follows it, slows, freezes when the two rates match, and then turns backwards while the wheel itself keeps speeding up. Every flash adds a point to the diagram on the right, so the characteristic folding is measured by the wheel rather than asserted beside it. Nothing in the strobed record reveals that anything has gone wrong.

Run the laboratory now, then come back. Three things are worth doing before you read on:

Derive the result

Letting the period go to infinity. A signal that never repeats can be treated as one that repeats after a very long time — and then the time is sent to infinity. Start from module 03’s pair, with ω0=2π/T\omega_0 = 2\pi/T the spacing between neighbouring harmonics, and define

F(nω0)≡T cn=∫Tf(t) e−inω0t dt.F(n\omega_0) \equiv T\, c_n = \int_{T} f(t)\, e^{-\ii n \omega_0 t}\,\mathrm{d}t .

The synthesis sum then reads f(t)=∑n1TF(nω0) einω0tf(t) = \sum_n \frac{1}{T} F(n\omega_0)\, e^{\ii n \omega_0 t}, and writing 1/T=ω0/2π=Δω/2π1/T = \omega_0/2\pi = \Delta\omega/2\pi turns it into

f(t)=12π∑nF(nω0) einω0t Δω.f(t) = \frac{1}{2\pi}\sum_{n} F(n\omega_0)\, e^{\ii n \omega_0 t}\, \Delta\omega .

That is a Riemann sum. As T→∞T \to \infty the spacing Δω\Delta\omega goes to zero, the comb of allowed frequencies fills in, and the sum becomes an integral.

The comb has become a continuum, and that answers the puzzle. A clap has no harmonics because it has no period; it has a continuous density of frequency content instead, and F(ω)F(\omega) is that density. Asking “what frequency is a clap” presumes a comb with one tooth. The well-posed replacement is “what does its spectrum look like”, and the answer is: broad, because it is short.

Where the phasor lands. Module 00 attached the phasor x^=Ae−iφ\hat{x} = A e^{-\ii\varphi} to the time factor e−iω0te^{-\ii\omega_0 t}. Under the forward transform above, that clockwise factor lives at negative frequency. Writing a real cosine as the two exponentials module 00 already identified,

x(t)=Re⁡ ⁣[x^ e−iω0t]=12x^ e−iω0t+12x^∗ e+iω0t,x(t) = \Real\!\left[\hat{x}\,e^{-\ii\omega_0 t}\right] = \tfrac12 \hat{x}\, e^{-\ii\omega_0 t} + \tfrac12 \hat{x}^{*}\, e^{+\ii\omega_0 t},

and transforming term by term with the sifting property of the delta function,

F(ω)=πx^ δ(ω+ω0)+πx^∗ δ(ω−ω0).F(\omega) = \pi\hat{x}\,\delta(\omega + \omega_0) + \pi\hat{x}^{*}\,\delta(\omega - \omega_0) .

So the course phasor sits at −ω0-\omega_0 and its conjugate at +ω0+\omega_0. This is not an artefact to be tidied away. A real signal must have F(−ω)=F(ω)∗F(-\omega) = F(\omega)^{*} — that is exactly the condition for the inverse transform to come out real — so the two halves are not independent, and neither is redundant. Delete the negative half and invert, and you do not recover the signal: you get a complex object whose real part is half the original. That object has a name, the analytic signal, and it is the subject of the advanced section.

The pair zoo. Four transforms do most of the work in this course, and each is worth deriving once so that it can be recognised forever.

Rectangle and sinc. A pulse of height 1 and full width aa, centred on t=0t = 0:

F(ω)=∫−a/2a/2e−iωt dt=2sin⁡(ωa/2)ω=a sinc⁡ ⁣(ωa2),F(\omega) = \int_{-a/2}^{a/2} e^{-\ii\omega t}\,\mathrm{d}t = \frac{2\sin(\omega a/2)}{\omega} = a\,\operatorname{sinc}\!\left(\frac{\omega a}{2}\right),

with zeros wherever ωa/2\omega a/2 is a multiple of π\pi. Halve the pulse width and every zero moves twice as far out: the spectrum is stretched by exactly the factor the pulse was squeezed. Module 29-fraunhofer meets this same curve on a screen, with a slit in place of aa.

Gaussian and Gaussian. For f(t)=e−t2/2σ2f(t) = e^{-t^2/2\sigma^2}, completing the square in the exponent gives

F(ω)=2π σ e−σ2ω2/2.F(\omega) = \sqrt{2\pi}\,\sigma\, e^{-\sigma^2\omega^2/2} .

A Gaussian of width σ\sigma transforms to a Gaussian of width 1/σ1/\sigma. It is the only shape in the zoo that keeps its form, and — not coincidentally — the one that meets the bandwidth theorem with equality.

One-sided exponential and Lorentzian. A decay switched on at t=0t = 0, f(t)=e−t/τf(t) = e^{-t/\tau} for t≥0t \ge 0 and zero before:

F(ω)=∫0∞e−t/τ e−iωt dt=11/τ+iω,F(\omega) = \int_{0}^{\infty} e^{-t/\tau}\,e^{-\ii\omega t}\,\mathrm{d}t = \frac{1}{1/\tau + \ii\omega},

whose magnitude is a Lorentzian of half-width 1/τ1/\tau. This is module 02’s resonance curve again, and the statement it makes is the one physicists call the linewidth-lifetime relation: a state that decays quickly has a broad line. It returns as the laser linewidth of module 45-lasers and the cavity line of module 26-fabry-perot.

Comb and comb. A train of impulses spaced TT apart transforms to a train of impulses spaced 2π/T2\pi/T apart. Module 03 has already proved it: the comb is periodic, so it has a Fourier series, and every one of its coefficients is 1/T1/T — equal weight on every harmonic. Fine spacing in time means coarse spacing in frequency, and this pair is the engine of the sampling discussion below.

The convolution theorem. Define the convolution (f∗g)(t)=∫f(τ)g(t−τ) dτ(f * g)(t) = \int f(\tau) g(t - \tau)\,\mathrm{d}\tau — one signal smeared with the shape of the other. Transform it, swap the order of integration, and substitute u=t−τu = t - \tau:

∫ ⁣ ⁣∫f(τ)g(t−τ)e−iωt dτ dt=∫f(τ)e−iωτ dτ∫g(u)e−iωu du.\int\!\!\int f(\tau) g(t-\tau) e^{-\ii\omega t}\,\mathrm{d}\tau\,\mathrm{d}t = \int f(\tau) e^{-\ii\omega \tau}\,\mathrm{d}\tau \int g(u) e^{-\ii\omega u}\,\mathrm{d}u .

Parseval. Taking the conjugate of the inverse transform and substituting once gives

∫−∞∞∣f(t)∣2 dt=12π∫−∞∞∣F(ω)∣2 dω.\int_{-\infty}^{\infty} |f(t)|^2\,\mathrm{d}t = \frac{1}{2\pi}\int_{-\infty}^{\infty} |F(\omega)|^2\,\mathrm{d}\omega .

The energy is the same whichever way you count it. That is what licenses reading a spectrum panel as an energy budget rather than as a picture.

The bandwidth theorem. Define the RMS widths as the second moments of ∣f∣2|f|^2 and ∣F∣2|F|^2 about their centroids. Then, for every signal,

This is a theorem, not an engineering limit, and it is the same inequality — with different names on the axes — as the coherence length of module 27-coherence, the divergence of a focused beam in module 43-gaussian-beams, and the position-momentum uncertainty of quantum mechanics. A femtosecond laser pulse of 10 fs duration cannot have a linewidth narrower than about 5×10135 \times 10^{13} rad/s, which is why ultrafast lasers are necessarily broadband.

The bridge to sampled data. Every measurement is a finite list of numbers, and two things happen on the way there — both of them corollaries of the convolution theorem.

Sampling multiplies by a comb. Recording at spacing Δt\Delta t multiplies the signal by an impulse train, so by the convolution theorem the spectrum is convolved with a comb: it is copied, endlessly, at spacing 2π/Δt2\pi/\Delta t. If the signal’s content is confined below ωNyq=π/Δt\omega_{\text{Nyq}} = \pi/\Delta t the copies do not overlap and nothing is lost. If it is not, the copies overlap and add, and content above Nyquist reappears folded down below it, indistinguishable from content that was genuinely there.

A finite record multiplies by a rectangle. Recording for a finite time multiplies by a rect, so the spectrum is convolved with that rect’s transform, a sinc. A pure tone therefore appears not as a spike but as a sinc, with sidelobes that spill across neighbouring frequencies. This is spectral leakage, and its width is set by the record length: Δω∼2π/T\Delta\omega \sim 2\pi/T. Leakage is a property of your window, not of the signal, which is why it is a mistake to read structure in the sidelobes as physics.

Finally, the transform the computer actually evaluates is the discrete sum Xk=∑nxn e−2πikn/NX_k = \sum_n x_n\, e^{-2\pi\ii k n/N}, and multiplying it by Δt\Delta t approximates F(ωk)F(\omega_k) — that scaling is what wavelab.fourier.spectrum applies so that the analytic pairs above can be drawn straight over the numerics. Padding the record with zeros puts more points on the same underlying curve; it interpolates the spectrum, it does not resolve anything new. Resolution comes from recording longer, and from nothing else.

Verify computationally

Each check below is also a test in the project’s suite, so these claims cannot silently rot.

1. The zoo against the FFT. The Gaussian pair agrees with its closed form to 3×10−163\times 10^{-16} — machine precision. The rect does not, and the reason is the same smoothness story module 03 told: a sampled discontinuity costs accuracy, and the error here falls only as Δt\Delta t, measured at 2.4×10−22.4\times10^{-2}, 1.2×10−21.2\times10^{-2} and 5.9×10−35.9\times10^{-3} as the grid is halved twice. Zero-padding does not repair it, because padding interpolates the transform of the sampled rect rather than converting it into the continuous sinc.

2. The round trip. inverse_spectrum(spectrum(f)) returns the signal to 3×10−163\times10^{-16}, and Parseval balances to one part in 1013.

3. Where the phasor lands.

4. The convolution theorem. The spectrum of a numerically convolved pair matches the product of their spectra to a relative 4×10−164\times10^{-16}.

5. The bandwidth floor. RMS products are measured across shapes. The Gaussian returns 0.500000; a chirped Gaussian, whose ∣f∣2|f|^2 is identical to the plain one, returns more — the excess coming entirely from phase. No shape returns less.

Transfer the idea

Check your understanding

  1. A signal switches on abruptly at t = 0 and then decays smoothly with time constant tau. Without integrating anything, which magnitude spectrum does it have?

    A. A single hump centred on zero frequency, of half-width about 1/tau — a Lorentzian. B. An oscillating sinc with regularly spaced zeros. C. A Gaussian, since a smooth decay is roughly bell-shaped. D. Two narrow spikes at plus and minus 1/tau.

    Check your answer

    Correct answer: A — A single hump centred on zero frequency, of half-width about 1/tau — a Lorentzian.

    • A. Right. The one-sided exponential transforms to 1/(1/tau + i omega), whose magnitude is a Lorentzian of half-width 1/tau. It is module 02’s resonance curve arriving from the other direction, and it is the linewidth-lifetime relation: a state that decays fast shows a broad line. The same curve returns as a laser linewidth and as a cavity response later in the course.

    • B. A sinc comes from a rectangle — something that switches on and off abruptly. This signal is sharp at one end only; the smooth decay at the other end is what removes the oscillation and leaves a single hump. Sharp edges make ringing spectra, and this signal has one edge, not two.

    • C. The Gaussian is the one shape that transforms into itself, and this signal is not one: it is discontinuous at t = 0 and one-sided. That discontinuity is exactly what gives the spectrum its slowly falling Lorentzian tails, which decay as 1/omega rather than being cut off sharply as a Gaussian’s are.

    • D. Spikes mean long-lived sinusoids — a signal that keeps oscillating at a definite frequency forever. A decay is the opposite case, and the shorter it is the broader its spectrum. Spikes would appear only in the limit tau to infinity, where the signal never decays at all.

  2. A pulse has an RMS duration of 2.0 milliseconds. What is the smallest RMS spectral width it can possibly have, in radians per second?

    Check your answer

    Correct answer: 250.0 (± 5.0)

    Delta t times Delta omega is at least 1/2, so the floor is 0.5 / 0.002 = 250 rad/s. Only a Gaussian pulse reaches it; every other shape is wider. Note the direction of the inequality: making the spectrum wider is easy — chirp the pulse, or square its edges — but nothing whatever makes it narrower at this duration. That is why a short laser pulse is necessarily broadband.

  3. A 60 Hz sine wave is sampled 100 times per second. At what frequency, in Hz, does the recorded data appear to show a tone?

    Check your answer

    Correct answer: 40.0 (± 1.0)

    The Nyquist frequency is half the sampling rate, 50 Hz, and content above it folds back down: the apparent frequency is 100 - 60 = 40 Hz. The point that matters more than the arithmetic is that the record contains no warning. A clean 40 Hz peak appears, and nothing in the data distinguishes it from a tone that was genuinely at 40 Hz. This is why Nyquist is a validity condition on the model rather than a quality setting.

  4. Two recordings are found to have identical magnitude spectra: |F(omega)| agrees at every frequency. What can you conclude about the two signals?

    A. Very little — the timing information is carried by the phase, so the two signals can be radically different. B. They are the same signal, possibly shifted in time. C. They must be time-reversed copies of each other. D. They differ at most by an overall amplitude factor.

    Check your answer

    Correct answer: A — Very little — the timing information is carried by the phase, so the two signals can be radically different.

    • A. Right. A brief click and a long chirp can share a magnitude spectrum exactly, and look nothing like each other. The transform does not discard the timing; it moves it into arg F, which the magnitude simply does not show. Reconstruct from the full complex spectrum and you recover the signal exactly; keep the magnitudes and randomise the phases and you get noise.

    • B. A time shift does preserve the magnitude spectrum — it multiplies the transform by a pure phase ramp — so shifted copies are one example. They are far from the only one. A chirp and a pulse can be built with identical magnitudes and completely different shapes, which is the whole content of the phase-retrieval problem. The magnitude is half the description.

    • C. Time reversal is another operation that preserves the magnitude spectrum, so it is a second example rather than the general answer. The set of signals sharing one magnitude spectrum is very large, because every frequency’s phase can be chosen independently.

    • D. An overall factor would scale the magnitude spectrum too, so it would not be identical. The signals here have exactly the same magnitude at every frequency and can still differ completely, because nothing has been said about their phases.

  5. The FFT of a real recording shows content at negative frequencies, mirroring the positive side. What is that half of the spectrum?

    A. The other half of every real oscillation — reality forces F(-omega) to be the conjugate of F(omega), and under this course’s convention the phasor of a cosine sits at -omega0. B. Redundant numerical noise that a careful implementation would discard. C. Content that was above the Nyquist frequency, folded down into the negative axis. D. An artefact of the finite record that shrinks as the recording gets longer.

    Check your answer

    Correct answer: A — The other half of every real oscillation — reality forces F(-omega) to be the conjugate of F(omega), and under this course’s convention the phasor of a cosine sits at -omega0.

    • A. Right, and the mirror symmetry is the signature. A real cosine is the sum of two counter-rotating exponentials, as module 00 showed, and the transform separates them: pi x_hat lands at -omega0 and its conjugate at +omega0. Deleting one half does not simplify the signal, it changes it — into the complex analytic signal, whose real part is half the original.

    • B. It is determined by the positive half rather than independent of it, which is not the same as being noise — it carries exactly half the signal’s energy, and Parseval will not balance without it. Discarding it and inverting produces a different, complex signal. That object is useful and has a name, but it is not the recording you started with.

    • C. That describes aliasing, which is a separate effect and folds content onto the positive axis as well. The negative half of a real signal’s spectrum is present even when the sampling is perfectly adequate and nothing has aliased at all; it is required by the signal being real.

    • D. That describes spectral leakage, which does narrow as the record lengthens. The negative-frequency half does not shrink with record length — it is exactly as large as the positive half no matter how long you record, because it is half of the signal.

  6. State the convolution theorem in both directions, in plain words, and give one physical situation where each direction is the useful one.

    Check your answer

    Convolving two signals in time multiplies their spectra; multiplying two signals in time convolves their spectra (with a factor of 1/2 pi). The first direction is the one that makes frequency response a useful idea at all: any linear time-invariant system — a filter, an amplifier, a lens, a spectrometer — acts on its input by convolution with a fixed response, so in the frequency domain it simply multiplies by a curve. A measured spectral line is the true lineshape convolved with the instrument’s response, which is why instrument functions are quoted and deconvolved. The second direction is where sampling and windowing get their consequences: sampling multiplies the signal by a comb, so the spectrum is convolved with a comb and therefore copied at the sampling frequency — overlap those copies and you have aliasing. Recording for a finite time multiplies by a rectangle, so the spectrum is convolved with a sinc, which is spectral leakage. Both effects are consequences of one theorem read in the multiplication-to-convolution direction, which is why they always arrive together with real data.

Exam-style problems for this module — the ones worth doing with a pen — are collected in the problem set.

Explain it in your own words

Answer in a few sentences each. These are the questions that reveal whether the ideas landed; no number will save you.

  1. Why is “what frequency is a hand-clap?” the wrong question, and what is the right one? Your answer should say what changed between module 03 and this one.

  2. A piano note’s character depends heavily on how it is struck, yet the magnitude spectrum of the sustained part barely changes. Where in the transform does the attack live?

  3. Explain aliasing to a film-maker who has noticed that wagon wheels sometimes turn backwards, without using the words Fourier, spectrum or Nyquist.

  4. A colleague reports a sharp spectral peak measured from a two-second recording and claims it resolves two lines 0.1 Hz apart. Which model-specification bullet should you point at, and what would you ask them to do?

Advanced: one-sided signals, windows, and the spectrogram

The analytic signal. Keeping only one half of a real signal’s spectrum and inverting gives a complex signal whose real part is half the original and whose magnitude is the original’s envelope — an extremely convenient object for anything that has an envelope and a carrier. Under the course convention the half to keep is the negative-frequency one, because that is where the clockwise phasor e−iω0te^{-\ii\omega_0 t} lives; engineering texts, rotating the other way, keep the positive half and call the same object by the same name. This closes the thread module 00 opened in its own advanced section, and the two conventions describe identical physics with mirrored bookkeeping.

Windows, and what they cost. Leakage comes from the abrupt ends of a finite record, so it can be reduced by tapering them — multiplying by a window that goes smoothly to zero, such as the Hann window. The sidelobes drop by orders of magnitude. The cost is paid in the main lobe, which roughly doubles in width: leakage control is bought with resolution, one for the other, and no window escapes the trade. It is module 03’s Fejér sum in a new domain, making the same bargain.

Trading one for the other, deliberately. The bandwidth theorem forbids perfect resolution in both domains at once, but it does not forbid choosing where to spend the budget. Cut a long record into short overlapping pieces, transform each, and stack the results into a time-frequency image: the spectrogram. Short pieces give sharp timing and blurred frequency; long pieces the reverse. Every spectrogram you have ever seen is a choice about that trade, made explicit in the length of one window, and the theorem above is the reason the choice cannot be avoided.