Quant Memo
Advanced

The Fourier Transform

Any wiggly signal, however messy, is a sum of plain sine waves at different frequencies — the Fourier transform is the recipe for reading off exactly which frequencies are in it and how strong each one is.

Prerequisites: Taylor Series Expansion, Limits and Continuity

A minute of a stock's intraday trades looks like noise — an irregular zigzag with no obvious pattern. Yet somewhere buried in that zigzag might be a genuine, repeating daily cycle (more volume at the open and close), a faster microstructure oscillation, and pure randomness on top. How do you separate "genuine repeating pattern at frequency X" from "everything else" inside a signal that, to the eye, just looks jagged? The Fourier transform is the tool built exactly for this: it takes any signal and rewrites it as a recipe of plain sine waves, one weight per frequency, so a hidden cyclical pattern shows up as a single sharp number instead of being smeared invisibly across the whole time series.

The analogy: unmixing paint back into pure colours

Imagine someone hands you a jar of murky brown paint and asks: how much red, how much blue, how much yellow went into this? You can't tell by looking — the mixture erased the individual colours. But if you had a machine that could physically un-mix any paint back into its pure component colours and tell you the exact proportion of each, you'd have complete information about what went in, just organised completely differently — not "what does it look like over time as you stir it" but "what pure ingredients, in what amounts, make it up." The Fourier transform is that machine for signals instead of paint: pure colours are replaced by pure sine waves of different frequencies, and "how much of each" is replaced by a precise, computable number for every frequency.

Writing it down

For a signal f(t)f(t), the Fourier transform is:

f^(ω)=f(t)eiωtdt.\hat f(\omega) = \int_{-\infty}^{\infty} f(t)\, e^{-i\omega t}\, dt .

In words: f^(ω)\hat f(\omega) measures how much of frequency ω\omega is present in ff. The term eiωte^{-i\omega t} is a compact way of writing a spinning unit vector — cos(ωt)isin(ωt)\cos(\omega t) - i\sin(\omega t) — that spins at exactly frequency ω\omega. Multiplying f(t)f(t) by this spinner and integrating (summing continuously) over all time acts like a filter: if ff genuinely oscillates at frequency ω\omega, the product stays lined up in the same rotational direction throughout and the sum accumulates to something large; if ff has no component at that frequency, the products point every which way as tt varies and they cancel each other out to nearly zero. Sweeping ω\omega across all possible frequencies and recording the size of f^(ω)\hat f(\omega) at each one produces the full "recipe" — the spectrum — of the original signal.

The reverse direction, the inverse Fourier transform, rebuilds f(t)f(t) by adding all those pure frequencies back together, each weighted by f^(ω)\hat f(\omega):

f(t)=12πf^(ω)eiωtdω.f(t) = \frac{1}{2\pi}\int_{-\infty}^{\infty} \hat f(\omega)\, e^{i\omega t}\, d\omega .

In words: the original signal equals a weighted sum (technically a continuous sum, i.e. an integral) of pure sine waves at every frequency, using exactly the weights just extracted. Nothing is lost going from ff to f^\hat f and back — it's a genuine change of viewpoint, not an approximation.

In quantitative finance the same machinery reappears as the characteristic function of a random variable, ϕ(u)=E[eiuX]\phi(u) = \mathbb{E}[e^{iuX}] — literally the Fourier transform of a probability density. Models like Heston have a known, tractable characteristic function even when their actual probability density has no clean formula, and Fourier-based pricing methods (Carr-Madan, COS) exploit exactly this: transform, do the easy part in frequency space, transform back.

Function explorer
-2222.0
x = 1.00f(x) = 2.000

Picture stacking several sine waves of different frequencies and amplitudes on top of each other — a low, slow wave plus a faster, smaller wiggle riding on it, and so on. Any shape this explorer's curve family can approximate is, in spirit, what the Fourier transform is unpacking in reverse: reading a complicated shape back into its list of pure-frequency ingredients.

composite signal f(t) 3 1 freq = 2 freq = 5 spectrum
The Fourier transform of the composite signal above: it has no visible "frequency 2" or "frequency 5" label in the time view, but the spectrum reads the amplitudes straight off — 3 units at frequency 2, 1 unit at frequency 5, and nothing anywhere else.

Worked example 1: transforming a simple two-frequency signal, by hand

Take a signal that is exactly the sum of two sine waves: f(t)=3sin(2t)+1sin(5t)f(t) = 3\sin(2t) + 1\sin(5t), sampled at a few points to see the frequencies separate. Rather than the full continuous integral, use the discrete intuition: correlate f(t)f(t) against sin(2t)\sin(2t) over one full cycle. Since sin(2t)\sin(2t) and sin(5t)\sin(5t) are orthogonal over a full period (their product integrates to exactly zero — a standard fact, the same orthogonality idea as perpendicular vectors), only the matching term survives:

02πf(t)sin(2t)dt=302πsin2(2t)dt+102πsin(5t)sin(2t)dt=3(π)+0=3π.\int_0^{2\pi} f(t)\sin(2t)\,dt = 3\int_0^{2\pi}\sin^2(2t)\,dt + 1\int_0^{2\pi}\sin(5t)\sin(2t)\,dt = 3(\pi) + 0 = 3\pi .

Dividing by the normalising constant π\pi (which is what 02πsin2(2t)dt\int_0^{2\pi}\sin^2(2t)dt evaluates to) recovers exactly 33 — the amplitude of the frequency-2 component, with the frequency-5 component contributing exactly zero to this particular measurement. Repeating with sin(5t)\sin(5t) in place of sin(2t)\sin(2t) recovers 11, the other amplitude, again with zero leakage from the frequency-2 term. This is the Fourier transform in miniature: correlate against each candidate frequency, and orthogonality lets each one report its own strength with no interference from the others.

Worked example 2: reading a spectrum, five bars of "noisy" data

Take five hourly volume figures: 100,140,100,60,100100, 140, 100, 60, 100 — a bump in hour 2, a dip in hour 4, flat elsewhere, which looks by eye like noise around a level of 100. A discrete Fourier transform on 5 points computes, for each frequency index k=0,,4k=0,\ldots,4, the sum t=04xtei2πkt/5\sum_{t=0}^4 x_t\, e^{-i2\pi kt/5}.

For k=0k=0 (the "zero frequency," i.e. the average level): x^0=100+140+100+60+100=500\hat x_0 = 100+140+100+60+100=500, and dividing by 5 gives the mean, 100100 — as expected, the zero-frequency component is just the overall level.

For kk corresponding to "one full cycle across the 5 hours," the calculation (mechanical but tedious by hand, using cos(72°)=0.309\cos(72°)=0.309 and sin(72°)=0.951\sin(72°)=0.951) picks up the +40+40 bump at hour 2 and 40-40 dip at hour 4 as a genuine oscillation at that frequency, with a magnitude noticeably larger than the other, unused frequency bins — meaning what looked like "random" hour-to-hour noise actually contains a real, single-cycle-per-5-hours pattern, exactly the kind of hidden periodicity a Fourier decomposition is built to surface.

What this means in practice

  • It's the standard route to pricing options under models without a closed-form density. Heston, Variance Gamma, and other stochastic-volatility or jump models have tractable characteristic functions even when their densities don't have simple formulas — Fourier-based pricers (Carr-Madan, COS method) transform the problem, solve the easy version, and transform back.
  • It's how desks detect genuine seasonality versus noise in intraday volume, order flow, or volatility patterns — a real recurring cycle shows up as a sharp spike in the frequency spectrum, distinguishable from broadband randomness which spreads flatly across all frequencies.
  • The Fast Fourier Transform (FFT) makes it computationally cheap. A direct calculation over nn points costs order n2n^2 operations; the FFT algorithm computes the same result in order nlognn\log n, which is what makes Fourier-based option pricing and large-scale time-series filtering practical in production.

The Fourier transform rewrites any signal as a weighted sum of pure sine waves at every frequency, with f^(ω)\hat f(\omega) telling you the strength of frequency ω\omega specifically. It works because sine waves at different frequencies are mutually orthogonal — correlating a signal against one frequency picks up only that frequency's contribution and nothing from any other, exactly like taking one coordinate of a vector against a perpendicular basis.

The classic confusion is treating the Fourier transform as something that only applies to smooth, periodic signals like sound waves. In finance it's used constantly on objects that are neither: probability densities (via the characteristic function) and even option payoffs themselves. The practical trap is assuming a spike in the frequency spectrum always means a genuine repeating pattern — with a short, noisy sample (say, a week of 5-minute bars), random noise alone produces spurious-looking spikes at some frequency purely by chance, the frequency-domain twin of finding a "pattern" in a small sample of coin flips. A spectral spike needs statistical significance testing or a longer sample before it's treated as a real, tradeable cycle rather than noise that happened to land at one frequency.

Related concepts

Practice in interviews

Further reading

  • Bracewell, The Fourier Transform and Its Applications (ch. 1-2)
  • Carr & Madan, Option Valuation Using the Fast Fourier Transform (1999)
ShareTwitterLinkedIn