Skip to content
LumenaryAcademy
Signals 65 min

Fourier series and the Fourier transform

Every signal is a sum of sinusoids, and every LTI system simply rescales each one. How to find the sinusoids, what the spectrum tells you, and why short means wide.

Code tested · 5AI-draftedAwaiting review by an electrical engineer

Your guides: Chloe · The Physicist, Margaret · The Bench Engineer, Gideon · The Design Reviewer

MotivationH

Splitting a signal into notes

Play a chord on a piano and a microphone records a single wiggly voltage. Yet your ear hears three notes, and a trained musician can name them. Somewhere between the air and your brain, the signal has been split into its frequencies. A prism does the same to light, and an equaliser on a music player does it to sound, turning some frequencies up and others down.

Joseph Fourier's claim, made in a memoir on heat in 1807 and met with scepticism by some of the greatest mathematicians of his day, was that this splitting always works: essentially any signal can be written as a sum of sinusoids. Engineers care about this for a reason you met at the end of Signals, systems and convolution: complex exponentials pass through LTI systems unchanged in shape, merely multiplied by a number. So if a signal is a sum of exponentials, the output of any LTI system is the same sum with each term rescaled. Convolution, a tangle of sums or integrals, becomes multiplication, one frequency at a time.

This lesson builds the two tools that do the splitting. The Fourier series handles periodic signals, such as a clock or a PWM waveform, and uses a discrete set of frequencies. The Fourier transform handles signals of any shape, such as a pulse or a spoken word, and uses a continuum of them. Along the way you will compute the overshoot that never goes away, measure what fraction of a signal's power lies in each harmonic, and meet the uncertainty relation that forbids a signal from being both short and narrow-band.

IntuitionH

Why complex exponentials?

Feed the complex exponential x(t)=estx(t) = e^{st}, with ss any complex number, into an LTI system with impulse response hh. Convolution gives y(t)=∫−∞∞h(τ) es(t−τ) dτ=(∫−∞∞h(τ) e−sτ dτ)⏟H(s)est.y(t) = \int_{-\infty}^{\infty} h(\tau)\, e^{s(t - \tau)}\, d\tau = \underbrace{\left(\int_{-\infty}^{\infty} h(\tau)\, e^{-s\tau}\, d\tau\right)}_{H(s)} e^{st}. The output is the input times a constant H(s)H(s), provided the integral converges. Complex exponentials are eigenfunctions of every LTI system, and H(s)H(s) is the corresponding eigenvalue.

LTI systemimpulse response h(t)ejωtH(jω) ejωt
The eigenfunction property. A complex exponential goes into an LTI system and comes out unchanged in shape, multiplied by one complex number, the frequency response at that frequency.

On the imaginary axis, s=jωs = j\omega, the input is a pure oscillation and H(jω)=∫−∞∞h(t) e−jωt dtH(j\omega) = \int_{-\infty}^{\infty} h(t)\, e^{-j\omega t}\, dt is the frequency response, the same quantity you measured for filters in Frequency response and filters. For a system with a real impulse response, H(−jω)=H(jω)‾H(-j\omega) = \overline{H(j\omega)}, and adding the responses to ejωte^{j\omega t} and e−jωte^{-j\omega t} gives the rule for real sinusoids: cos⁡(ωt)  ⟼  ∣H(jω)∣ cos⁡(ωt+∠H(jω)).\cos(\omega t) \;\longmapsto\; |H(j\omega)|\, \cos\bigl(\omega t + \angle H(j\omega)\bigr). The magnitude scales the amplitude and the angle shifts the phase. For the RC low-pass with impulse response h(t)=e−t/τu(t)/τh(t) = e^{-t/\tau}u(t)/\tau, the integral gives H(jω)=1/(1+jωτ)H(j\omega) = 1/(1 + j\omega\tau), exactly the phasor result ZC/(R+ZC)Z_C/(R + Z_C) from AC and phasors. The phasor method was Fourier analysis all along, applied one frequency at a time.

The program of the rest of the lesson is now clear: learn to write a signal as a sum (or integral) of complex exponentials, and learn what that representation tells you.

DefinitionsH

Fourier series of periodic signals

A signal is periodic with period TT if x(t+T)=x(t)x(t + T) = x(t) for all tt. Its fundamental frequency is f0=1/Tf_0 = 1/T, or ω0=2π/T\omega_0 = 2\pi/T in radians per second. The only complex exponentials with period TT are the harmonics ejkω0te^{jk\omega_0 t} for integers kk, so a periodic signal should be a combination of them.

Definition— Fourier series

A periodic signal x(t)x(t) with period TT has the Fourier series x(t)=∑k=−∞∞ck ejkω0t,ck=1T∫0Tx(t) e−jkω0t dt.x(t) = \sum_{k=-\infty}^{\infty} c_k\, e^{jk\omega_0 t}, \qquad c_k = \frac{1}{T} \int_0^T x(t)\, e^{-jk\omega_0 t}\, dt . The first formula is the synthesis equation (build the signal from harmonics); the second is the analysis equation (find how much of each harmonic it contains). The coefficient c0c_0 is the average (DC) value. For a real signal, c−k=ck‾c_{-k} = \overline{c_k}, and pairing the terms kk and −k-k gives the real form x(t)=c0+∑k≥12∣ck∣cos⁡(kω0t+∠ck)x(t) = c_0 + \sum_{k \ge 1} 2|c_k| \cos(k\omega_0 t + \angle c_k).

Theorem— The analysis formula

If x(t)=∑kckejkω0tx(t) = \sum_k c_k e^{jk\omega_0 t} (with the sum converging well enough to integrate term by term), then cm=1T∫0Tx(t) e−jmω0t dtc_m = \frac{1}{T}\int_0^T x(t)\,e^{-jm\omega_0 t}\,dt for every integer mm.

Proof

The harmonics are orthogonal over one period: for integers k≠mk \ne m, 1T∫0Tejkω0t e−jmω0t dt=1T∫0Tej(k−m)ω0t dt=1T[ej(k−m)ω0tj(k−m)ω0]0T=0,\frac{1}{T}\int_0^T e^{jk\omega_0 t}\, e^{-jm\omega_0 t}\, dt = \frac{1}{T}\int_0^T e^{j(k-m)\omega_0 t}\, dt = \frac{1}{T}\left[\frac{e^{j(k-m)\omega_0 t}}{j(k-m)\omega_0}\right]_0^T = 0, because ej(k−m)ω0T=ej(k−m)2π=1e^{j(k-m)\omega_0 T} = e^{j(k-m)2\pi} = 1. For k=mk = m the integrand is 1 and the average is 1. So multiplying the series by e−jmω0te^{-jm\omega_0 t} and averaging over a period kills every term except cmc_m.

∎

Example— The square wave

Let x(t)=+1x(t) = +1 for 0<t<T/20 < t < T/2 and −1-1 for T/2<t<TT/2 < t < T. Its average is zero, so c0=0c_0 = 0. For k≠0k \ne 0, ck=1T(∫0T/2e−jkω0t dt−∫T/2Te−jkω0t dt)=1T(1−e−jkπjkω0−e−jkπ−1jkω0)=1−(−1)kjπk,c_k = \frac{1}{T}\left(\int_0^{T/2} e^{-jk\omega_0 t}\,dt - \int_{T/2}^{T} e^{-jk\omega_0 t}\,dt\right) = \frac{1}{T}\left(\frac{1 - e^{-jk\pi}}{jk\omega_0} - \frac{e^{-jk\pi} - 1}{jk\omega_0}\right) = \frac{1 - (-1)^k}{j\pi k}, using ω0T=2π\omega_0 T = 2\pi and e−jkπ=(−1)ke^{-jk\pi} = (-1)^k. So ck=2jπkc_k = \dfrac{2}{j\pi k} for odd kk and 0 for even kk. Pairing kk with −k-k: x(t)=4π(sin⁡ω0t+13sin⁡3ω0t+15sin⁡5ω0t+⋯ ).x(t) = \frac{4}{\pi}\left(\sin\omega_0 t + \frac{1}{3}\sin 3\omega_0 t + \frac{1}{5}\sin 5\omega_0 t + \cdots\right). Only odd harmonics appear (because the second half of each period is the negative of the first), and their amplitudes fall like 1/k1/k, slowly, because of the jumps.

The program below computes the coefficients numerically, straight from the analysis integral, and compares them with the formula. Then it adds up the harmonics to see how well the partial sums SK(t)=4π∑k odd, k≤Ksin⁡kω0tkS_K(t) = \frac{4}{\pi}\sum_{k \text{ odd},\ k \le K} \frac{\sin k\omega_0 t}{k} reproduce the square wave.

python
import numpy as np

# One period (T = 1) of a square wave: +1 for the first half, -1 for the second.
M = 200_000
t = (np.arange(M) + 0.5) / M                 # midpoints of M equal slices
x = np.where(t < 0.5, 1.0, -1.0)

def coefficient(k):
    """c_k = (1/T) * integral over one period of x(t) exp(-j 2 pi k t / T) dt, by the midpoint rule."""
    return np.mean(x * np.exp(-2j * np.pi * k * t))

print(" k   numerical c_k          formula 2/(j pi k), odd k")
for k in range(0, 8):
    c = np.round(coefficient(k), 5) + 0.0      # + 0.0 turns -0.0 into 0.0
    formula = 2 / (1j * np.pi * k) if k % 2 else 0
    print(f"{k:2}   {c.real:+.5f}{c.imag:+.5f}j    {complex(formula).imag:+.5f}j")

# Partial sums S_K(t) = (4/pi) * sum over odd k <= K of sin(2 pi k t) / k.
tt = np.linspace(0, 0.5, 100_001)
print("\nharmonics up to K   peak of S_K   overshoot (% of the jump)   distance of peak from jump")
for K in (1, 3, 9, 19, 99, 999):
    S = np.zeros_like(tt)
    for k in range(1, K + 1, 2):
        S += 4 / np.pi * np.sin(2 * np.pi * k * tt) / k
    i = np.argmax(S)
    print(f"{K:17}   {S[i]:.5f}       {100 * (S[i] - 1) / 2:6.2f}                {min(tt[i], 0.5 - tt[i]):.4f}")

# Parseval: the power of the square wave is 1; how much is in the first few harmonics?
print("\nharmonics up to K   fraction of the power")
for K in (1, 3, 5, 9, 99):
    frac = sum(8 / (np.pi ** 2 * k ** 2) for k in range(1, K + 1, 2))
    print(f"{K:17}   {frac:.4f}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
+1−1t0T/2TK = 1K = 5K = 25overshoot ≈ 9% of the jump
The square wave (dashed) and its partial Fourier sums up to harmonic K = 1, 5 and 25. More harmonics give sharper edges and smaller ripples, but the first ripple beside each jump keeps overshooting by about 9% of the jump; it only gets narrower.

The Gibbs phenomenon

Look at the middle table. As more harmonics are added, the partial sum hugs the square wave more closely almost everywhere, yet the peak next to each jump does not shrink towards 1. It settles at 1.17898, an overshoot of 8.95% of the jump (which is 2 here), and the only thing that changes is where it happens: the peak sits at a distance T/(2(K+1))T/(2(K+1)) from the jump, closer and closer, but never lower. This is the Gibbs phenomenon. It happens at every jump of every signal, whatever its shape, because near a jump every signal looks like a square wave.

So in what sense does the series converge? At each fixed point where xx is continuous, SK(t)→x(t)S_K(t) \to x(t): the overshoot moves past any given point eventually. At a jump, the series converges to the midpoint of the jump (here 0). And the energy of the error, ∫0T∣x−SK∣2 dt\int_0^T |x - S_K|^2\,dt, tends to zero. What fails is uniform convergence: the overshoot of about 0.18 never goes away, so the largest error over a period does not tend to zero.

The Gibbs overshoot is not just a curiosity. Any system that cuts off all frequencies above some limit, an ideal low-pass filter, turns a sharp step into a step with this 9% ringing. That is why Digital filters tapers its filter coefficients with a window instead of truncating them abruptly, and why JPEG images show ripples beside sharp edges.

Power and Parseval

The last table answers a practical question: how much of the square wave's power is in each harmonic? Because the harmonics are orthogonal, their powers add with no cross terms. This is Parseval's relation for Fourier series: 1T∫0T∣x(t)∣2 dt=∑k=−∞∞∣ck∣2.\frac{1}{T}\int_0^T |x(t)|^2\, dt = \sum_{k=-\infty}^{\infty} |c_k|^2 . For the square wave the left side is 1, and harmonics ±k\pm k contribute 2∣ck∣2=8/(π2k2)2|c_k|^2 = 8/(\pi^2 k^2) for odd kk.

DefinitionsH

The Fourier transform

A pulse, a spoken word or a single radar echo is not periodic. Imagine stretching the period TT of a periodic signal to infinity: the harmonics kω0k\omega_0 crowd closer together, spaced ω0=2π/T→0\omega_0 = 2\pi/T \to 0 apart, and the sum over harmonics becomes an integral over all frequencies.

Definition— Fourier transform

The Fourier transform of a signal x(t)x(t) and its inverse are X(jω)=∫−∞∞x(t) e−jωt dt,x(t)=12π∫−∞∞X(jω) ejωt dω.X(j\omega) = \int_{-\infty}^{\infty} x(t)\, e^{-j\omega t}\, dt, \qquad x(t) = \frac{1}{2\pi}\int_{-\infty}^{\infty} X(j\omega)\, e^{j\omega t}\, d\omega . X(jω)X(j\omega) is the spectrum of xx: its magnitude ∣X∣|X| says how much of each frequency the signal contains, and its angle says with what phase. Engineers often use ordinary frequency ff in hertz instead, with ω=2πf\omega = 2\pi f: X(f)=∫x(t) e−j2πft dtX(f) = \int x(t)\,e^{-j2\pi f t}\,dt and x(t)=∫X(f) ej2πft dfx(t) = \int X(f)\,e^{j2\pi f t}\,df, which has no 2π2\pi to remember. We write x↔Xx \leftrightarrow X for a transform pair.

Notice that the frequency response H(jω)H(j\omega) of the previous section is the Fourier transform of the impulse response h(t)h(t). A handful of pairs are worth knowing by heart:

Signal x(t)x(t)Spectrum X(f)X(f)Note
δ(t)\delta(t)11an impulse contains every frequency equally
11 for ∣t∣<τ/2\lvert t\rvert < \tau/2, else 0τ sinc(fτ)\tau\,\mathrm{sinc}(f\tau)sinc(u)=sin⁡(πu)/(πu)\mathrm{sinc}(u) = \sin(\pi u)/(\pi u), zeros at f=±1/τ,±2/τ,…f = \pm 1/\tau, \pm 2/\tau, \dots
e−atu(t)e^{-at}u(t), a>0a > 01a+j2πf\dfrac{1}{a + j2\pi f}the RC circuit's impulse response, up to scale
e−πt2e^{-\pi t^2}e−πf2e^{-\pi f^2}the Gaussian is its own transform
cos⁡(2πf0t)\cos(2\pi f_0 t)12δ(f−f0)+12δ(f+f0)\tfrac12\delta(f - f_0) + \tfrac12\delta(f + f_0)a power signal: its spectrum is two impulses

The transform's usefulness comes from its properties. Each can be proved in a line or two from the definition.

PropertyTime domainFrequency domain
Linearityax1+bx2a x_1 + b x_2aX1+bX2a X_1 + b X_2
Time shiftx(t−t0)x(t - t_0)e−j2πft0X(f)e^{-j2\pi f t_0} X(f)
Frequency shift (modulation)ej2πf0t x(t)e^{j2\pi f_0 t}\, x(t)X(f−f0)X(f - f_0)
Scalingx(at)x(at)1∣a∣X(f/a)\frac{1}{\lvert a\rvert} X(f/a)
Differentiationx′(t)x'(t)j2πf X(f)j2\pi f\, X(f)
Convolution(x∗h)(t)(x * h)(t)X(f) H(f)X(f)\, H(f)
Multiplicationx(t) w(t)x(t)\, w(t)(X∗W)(f)(X * W)(f)
Parseval∫∣x(t)∣2dt\int \lvert x(t)\rvert^2 dt∫∣X(f)∣2df\int \lvert X(f)\rvert^2 df

Theorem— The convolution theorem

If y=x∗hy = x * h, then Y(f)=X(f) H(f)Y(f) = X(f)\,H(f).

Proof

Substitute the convolution into the transform and exchange the order of integration (valid when xx and hh are absolutely integrable): Y(f)=∫ ⁣ ⁣∫x(τ) h(t−τ) dτ e−j2πft dt=∫x(τ) e−j2πfτ(∫h(t−τ) e−j2πf(t−τ) dt)dτ.Y(f) = \int\!\!\int x(\tau)\, h(t - \tau)\, d\tau\, e^{-j2\pi f t}\, dt = \int x(\tau)\, e^{-j2\pi f\tau} \left(\int h(t - \tau)\, e^{-j2\pi f (t - \tau)}\, dt\right) d\tau . The inner integral, with the substitution u=t−τu = t - \tau, is H(f)H(f) whatever τ\tau is, so it comes out, leaving ∫x(τ) e−j2πfτ dτ⋅H(f)=X(f)H(f)\int x(\tau)\,e^{-j2\pi f\tau}\,d\tau \cdot H(f) = X(f)H(f).

∎

This is the result promised in the last lesson: convolution in time is multiplication in frequency. A filter's output spectrum is the input spectrum times the frequency response, one frequency at a time. The time-shift property says a delay changes only the phase, by an amount proportional to frequency, never the magnitude. The modulation property is the basis of radio: multiplying by a carrier slides the whole spectrum up to the carrier frequency, as Modulation will show.

The program below checks three of these claims numerically, computing each transform as a Riemann sum of the defining integral.

python
import numpy as np

dt = 1e-6                                     # 1 microsecond time step
t = np.arange(-5e-3, 5e-3, dt) + dt / 2       # a 10 ms window of time, midpoints

def ft(x, f):
    """X(f) = integral of x(t) exp(-j 2 pi f t) dt, as a midpoint sum, at each frequency in f."""
    return np.array([np.sum(x * np.exp(-2j * np.pi * fk * t)) * dt for fk in f])

tau = 1e-3
rect = np.where(np.abs(t) < tau / 2, 1.0, 0.0)          # a 1 ms pulse of height 1, centred at 0
f = np.array([0, 250, 500, 1000, 1500, 2000, 2500])
X = ft(rect, f)
print("  f (Hz)    |X(f)| numerical   tau |sinc(f tau)|")
for fk, Xk in zip(f, X):
    print(f"{fk:8}    {abs(Xk) * 1e3:.5f} ms        {tau * abs(np.sinc(fk * tau)) * 1e3:.5f} ms")

# Time shift: delay the pulse by 0.4 ms. The magnitude is unchanged; the phase gains -2 pi f t0.
t0 = 0.4e-3
shifted = np.where(np.abs(t - t0) < tau / 2, 1.0, 0.0)
Xs = ft(shifted, np.array([250.0]))[0]
print(f"\nshifted pulse at 250 Hz: |X| = {abs(Xs) * 1e3:.5f} ms, phase = {np.angle(Xs):+.4f} rad,"
      f" predicted -2 pi f t0 = {-2 * np.pi * 250 * t0:+.4f} rad")

# Convolution theorem: rect * rect is a triangle; its transform should be X(f)^2.
tri = np.convolve(rect, rect, mode="same") * dt
f2 = np.array([0, 300, 700, 1200])
print("\n  f (Hz)    transform of rect*rect     X(f)^2")
for fk, a, b in zip(f2, ft(tri, f2), ft(rect, f2) ** 2):
    print(f"{fk:8}    {a.real * 1e6:+.5f} ms^2           {b.real * 1e6:+.5f} ms^2")

# Parseval: energy in time = energy in frequency. How much lies inside the main lobe |f| < 1/tau?
E_time = np.sum(rect ** 2) * dt
df = 0.1                                       # Hz
ff = np.arange(-1 / tau, 1 / tau, df) + df / 2
E_lobe = np.sum(np.abs(tau * np.sinc(ff * tau)) ** 2) * df
print(f"\nenergy in time: {E_time * 1e3:.4f} ms;  fraction inside the main lobe |f| < 1 kHz: {E_lobe / E_time:.4f}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The numerical transform of the 1 ms pulse matches τ sinc(fτ)\tau\,\mathrm{sinc}(f\tau) to five figures, with zeros at 1 kHz and 2 kHz. Delaying the pulse by 0.4 ms leaves ∣X∣|X| at 0.90032 ms and turns the phase by exactly −2π×250×0.0004=−0.6283-2\pi \times 250 \times 0.0004 = -0.6283 rad. The triangle, which is the pulse convolved with itself, has transform X(f)2X(f)^2. And Parseval's theorem says that 90.28% of the pulse's energy lies in the main lobe of its spectrum, between −1-1 and +1+1 kHz.

Worked examplesH

Spectra and bandwidth

The bandwidth of a signal is, loosely, the width of the range of frequencies it occupies. It matters because every channel, a cable, a radio band, an amplifier, an analogue-to-digital converter, passes only a limited range of frequencies, and the spectrum is a shared and regulated resource. But "the width" of a spectrum like a sinc, which never quite ends, needs a definition, and engineers use several:

  • Half-power (3 dB) bandwidth: the width of the band where ∣X∣2|X|^2 is at least half its peak, the definition used for filters in Frequency response and filters.
  • Null-to-null bandwidth: the width of the main lobe, from the first zero on one side to the first on the other; 2/τ2/\tau for a pulse of duration τ\tau.
  • Fractional-energy (occupied) bandwidth: the narrowest band holding a given fraction of the energy, often 99%. Radio regulators use this kind of definition, because it captures the spill into neighbouring channels that the other two ignore.

For real signals the spectrum is symmetric, ∣X(−f)∣=∣X(f)∣|X(-f)| = |X(f)|, and one usually quotes the one-sided bandwidth, counting only positive frequencies. A signal whose spectrum is concentrated near f=0f = 0 is called baseband; one concentrated around a carrier frequency fcf_c is bandpass, and its bandwidth is measured around fcf_c.

Example— Bandwidths of everyday signals

  • Speech on a traditional telephone line was limited to about 300–3400 Hz, enough for intelligibility but not for the "s" and "f" sounds, which is why they are easy to confuse on the phone.
  • An AM broadcast station occupies about 9 or 10 kHz (the channel spacing in different regions of the world); an FM station about 200 kHz.
  • A Wi-Fi channel is 20 MHz wide in its basic form, and Wi-Fi 7 allows channels of up to 320 MHz; a 5G carrier below 7 GHz is up to 100 MHz wide (as of 2026).
  • A digital clock edge that rises in 1 ns has significant spectral content up to several hundred megahertz, whatever its clock rate. A first-order system whose 10–90% rise time is trt_r has a 3 dB bandwidth of 0.35/tr0.35/t_r, here 350 MHz, and engineers use the same figure as a rule of thumb for any edge.

The rectangular pulse shows the trade-off at the heart of all of this. Its spectrum τ sinc(fτ)\tau\,\mathrm{sinc}(f\tau) has its first zero at 1/τ1/\tau: halve the pulse and you double the bandwidth. This is the scaling property at work, x(at)↔X(f/a)/∣a∣x(at) \leftrightarrow X(f/a)/|a|: compressing a signal in time stretches its spectrum by the same factor.

duration τt1/τ−1/τfduration τ/2t2/τ−2/τfpulse x(t)spectrum |X(f)|
Short in time means wide in frequency. Halving a rectangular pulse's duration doubles the width of its spectrum's main lobe and halves its peak, which equals the pulse's area.
ComputationC

The time–bandwidth trade-off

Is there a limit? Could a clever pulse be both very short and very narrow in frequency? No. To make this precise, measure spread by root-mean-square widths. For a pulse centred at t=0t = 0 whose spectrum is centred at ω=0\omega = 0, with energy EE, define σt2=1E∫t2 ∣x(t)∣2 dt,σω2=12πE∫ω2 ∣X(jω)∣2 dω.\sigma_t^2 = \frac{1}{E}\int t^2\, |x(t)|^2\, dt, \qquad \sigma_\omega^2 = \frac{1}{2\pi E}\int \omega^2\, |X(j\omega)|^2\, d\omega .

Theorem— The uncertainty relation (Gabor's form)

For any signal with finite σt\sigma_t and σω\sigma_\omega, σt σω≥12\quad\sigma_t\, \sigma_\omega \ge \tfrac12, with equality only for Gaussian pulses x(t)=Ae−t2/(2s2)x(t) = A e^{-t^2/(2s^2)} (up to shifts in time and frequency).

Proof

By the differentiation property and Parseval, ∫ω2∣X∣2 dω/(2π)=∫∣x′(t)∣2 dt\int \omega^2 |X|^2\, d\omega/(2\pi) = \int |x'(t)|^2\, dt. Take xx real for simplicity. Integrating by parts (the boundary terms vanish when σt\sigma_t is finite), ∫t x x′ dt=12∫t (x2)′ dt=−12∫x2 dt=−E2\int t\, x\, x'\, dt = \tfrac12 \int t\, (x^2)'\, dt = -\tfrac12 \int x^2\, dt = -\tfrac{E}{2}. The Cauchy–Schwarz inequality gives (∫tx x′ dt)2≤∫t2x2 dt∫x′2 dt\bigl(\int t x\, x'\, dt\bigr)^2 \le \int t^2 x^2\, dt \int x'^2\, dt, that is, E2/4≤(Eσt2)(Eσω2)E^2/4 \le (E\sigma_t^2)(E\sigma_\omega^2), so σtσω≥12\sigma_t\sigma_\omega \ge \tfrac12. Equality in Cauchy–Schwarz needs x′(t)=−c t x(t)x'(t) = -c\,t\,x(t) for a constant c>0c > 0, whose solutions are exactly the Gaussians.

∎

The proof also gives a way to compute σω\sigma_\omega without computing a transform at all: σω2=∫∣x′∣2dt/E\sigma_\omega^2 = \int |x'|^2 dt / E. The program uses it to measure several pulse shapes. Time is in milliseconds, so σω\sigma_\omega comes out in radians per millisecond.

python
import numpy as np

dt = 2e-5
t = np.arange(-12, 12, dt) + dt / 2           # time in milliseconds, say

def spreads(x):
    """RMS duration and RMS bandwidth (in rad per unit time) of a pulse centred at t = 0.
    The bandwidth uses Parseval: integral of w^2 |X|^2 dw / 2 pi equals integral of |x'(t)|^2 dt."""
    E = np.sum(x ** 2) * dt
    sigma_t = np.sqrt(np.sum(t ** 2 * x ** 2) * dt / E)
    dx = np.gradient(x, dt)
    sigma_w = np.sqrt(np.sum(dx ** 2) * dt / E)
    return sigma_t, sigma_w

pulses = {
    "Gaussian, width 0.5":  np.exp(-t ** 2 / (2 * 0.5 ** 2)),
    "Gaussian, width 0.1":  np.exp(-t ** 2 / (2 * 0.1 ** 2)),
    "triangle":             np.clip(1 - np.abs(t), 0, None),
    "raised cosine (Hann)": np.where(np.abs(t) < 1, np.cos(np.pi * t / 2) ** 2, 0.0),
    "two-sided e^(-|t|)":   np.exp(-np.abs(t)),
}
print(f"{'pulse':22} {'sigma_t':>8} {'sigma_w':>8} {'product':>8}")
for name, x in pulses.items():
    st, sw = spreads(x)
    print(f"{name:22} {st:8.4f} {sw:8.4f} {st * sw:8.4f}")
print("lower bound: 0.5000, reached only by the Gaussian")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Making the Gaussian five times narrower (0.5 to 0.1) makes its bandwidth five times wider (1.41 to 7.07), and the product stays at exactly 0.5. Every other shape does worse: 0.513 for the smooth raised cosine, 0.548 for the triangle, 0.707 for the two-sided exponential with its sharp peak. A rectangular pulse is worse still: its jumps make ∫∣x′∣2\int|x'|^2 infinite, because its spectrum falls only as 1/f1/f, so its RMS bandwidth is infinite even though its main lobe is finite. That is a reminder that "bandwidth" depends on the definition.

Why engineers care

The same mathematics appears in quantum mechanics as Heisenberg's uncertainty principle, but for an engineer it is a design constraint met daily:

  • Radar and sonar. A short pulse locates a target precisely in range but needs a wide bandwidth; a long pulse carries more energy but blurs range. Pulse compression escapes the dilemma by transmitting a long pulse whose frequency sweeps (a chirp): its bandwidth is wide although its duration is long, and a matched filter in the receiver compresses it.
  • Digital communications. Sending symbols faster means each is shorter, so the signal needs more bandwidth. OFDM, used by Wi-Fi, 4G and 5G, splits a channel into many narrow subcarriers whose symbols are long. In LTE the subcarriers are 15 kHz apart and each symbol lasts 1/(15 kHz)≈66.7 μ1/(15\ \mathrm{kHz}) \approx 66.7\ \mus, a time–bandwidth product of exactly 1 by design.
  • Spectrum analysis. To tell apart two tones 1 Hz apart, you must listen for roughly a second. Sampling and the FFT makes this precise as the frequency resolution of the DFT.
  • Music. A note that lasts only 10 ms has a spread in frequency of the order of 100 Hz, so a very short note has no clearly defined pitch: drummers' clicks are heard as clicks, not as notes.
ExplanationH

Fourier analysis at work

Fourier analysis is so pervasive in electrical engineering that it is almost invisible. A few places it does daily work:

  • Instruments. A spectrum analyser displays ∣X(f)∣|X(f)| of a live signal. Classic swept analysers tune a narrow filter across the band; modern ones digitise the signal and compute FFTs, and "real-time" analysers do so fast enough not to miss brief events. Every oscilloscope now has an FFT button.
  • Power quality. Rectifiers in computer power supplies and LED drivers draw current in short pulses, which are rich in odd harmonics of 50 or 60 Hz. These harmonic currents heat transformers and distort the grid's voltage, so standards such as IEC 61000-3-2 limit the harmonic currents that equipment may draw, and power-factor-correction circuits reshape the current to be sinusoidal (see Power electronics).
  • Compression. Audio codecs (MP3, AAC, Opus) and image and video codecs (JPEG, H.264 and their successors) transform short blocks of the signal into frequency-like coefficients using close relatives of the Fourier transform, then spend bits only on the coefficients that people can perceive.
  • Communications. Every radio standard specifies a spectral mask: how much power a transmitter may emit at each offset from its channel. Modulation, filtering and OFDM are all designed in the frequency domain; Modulation and Wireless systems take this up.
  • Imaging. An MRI scanner measures the two- or three-dimensional Fourier transform of the body's magnetisation directly, and the image is reconstructed by an inverse transform.
Common misconceptionsH

Common misconceptions

Misconception

"Negative frequencies are unphysical, so they can be ignored." For a real signal the negative-frequency half of the spectrum is the mirror image (complex conjugate) of the positive half, so it carries no new information. But it is not zero, and the formulas need it: cos⁡ωt\cos\omega t is half ejωte^{j\omega t} plus half e−jωte^{-j\omega t}. For complex signals, used throughout radio receivers, positive and negative frequencies are genuinely different.

Misconception

"With enough harmonics the Gibbs overshoot disappears." It gets narrower, not lower: about 9% of the jump for any number of terms. Reducing it needs a different way of summing, for example tapering the high harmonics instead of cutting them off.

Misconception

"Only the magnitude spectrum matters; phase is a detail." Two signals with the same ∣X∣|X| and different phases can look nothing alike: a click and a slow chirp can have identical magnitude spectra. Phase carries the timing: where the edges and events are. For images, keeping the phase and replacing the magnitude produces a recognisable picture, while the reverse does not.

Misconception

"Every signal has a Fourier transform." The defining integral converges for absolutely integrable signals, and the theory extends to finite-energy ones. A sinusoid or a constant needs impulses in the spectrum, and a growing exponential etu(t)e^{t}u(t) has no Fourier transform at all. That gap is one reason for the Laplace transform of The Laplace transform and stability, which damps the signal first.

Misconception

"A signal's bandwidth is a single, well-defined number." It depends on the definition: 3 dB, null-to-null, 99% energy or RMS. For the rectangular pulse these give finite values except the RMS width, which is infinite. Always ask which definition is meant.

History & global context

A short history

Fourier submitted his memoir on heat flow to the Paris Academy in 1807; its claim that arbitrary functions could be expanded in sines and cosines troubled Lagrange, and the work appeared in full only in his book of 1822, Théorie analytique de la chaleur. Dirichlet gave the first rigorous conditions for convergence in 1829. The overshoot at jumps was found by the English mathematician Henry Wilbraham in 1848, forgotten, and rediscovered in 1898–99 in an exchange of letters in Nature prompted by Albert Michelson, who had built a mechanical harmonic analyser, and settled by Josiah Willard Gibbs. In the twentieth century the Fourier transform became the language of radio and telephony; in 1946 Dennis Gabor, then working in Britain, framed the time–frequency trade-off for communication engineers in the paper listed in the further reading. The publication of the fast Fourier transform algorithm in 1965 moved the whole subject onto computers, which is where the next lesson goes.

Exercises

Exercises

1. Fourier series and the Fourier transform

Warm-upHuman

A rectangular pulse lasts 2 ms. At what positive frequency, in hertz, is the first zero of its spectrum?

2. Fourier series and the Fourier transform

CoreHuman

A 1 kHz square wave switching between +1+1 V and −1-1 V passes through an ideal low-pass filter that passes everything below 4 kHz unchanged and blocks everything above. What percentage of the square wave's average power reaches the output? Give the nearest whole number.

3. Fourier series and the Fourier transform

Warm-upHuman

You add more and more harmonics to the Fourier series of a square wave. What happens to the overshoot just beside each jump?

Choose one

4. Fourier series and the Fourier transform

CoreHuman

A pulse x(t)x(t) is delayed by t0=3t_0 = 3 ms. What happens to its spectrum?

Choose one

5. Fourier series and the Fourier transform

Warm-upHuman

You want to tell apart two tones at 1000.0 Hz and 1000.5 Hz by measuring the spectrum of a recording. Using the rule of thumb that duration × bandwidth is at least about 1, roughly how many seconds must the recording last?

6. Fourier series and the Fourier transform

CoreComputational

Write fourier_coefficient(x, k). The array x holds MM samples of one period of a signal, taken at the midpoints tm=(m+12)T/Mt_m = (m + \tfrac12)T/M. Return the complex Fourier coefficient ck=1T∫0Tx(t) e−jkω0t dtc_k = \frac1T\int_0^T x(t)\,e^{-jk\omega_0 t}\,dt, approximated by the midpoint rule. The tests use a square wave, a sawtooth and a shifted cosine.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

7. Fourier series and the Fourier transform

CoreComputational

Write fourier_transform(x, t, f): given samples x of a signal at equally spaced times t (in seconds) and an array of frequencies f (in hertz), return the array of values X(f)=∫x(t) e−j2πft dtX(f) = \int x(t)\,e^{-j2\pi f t}\,dt, approximated by a Riemann sum. The tests check the Gaussian e−πt2↔e−πf2e^{-\pi t^2} \leftrightarrow e^{-\pi f^2}, a rectangular pulse, and the time-shift property.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources