The Fourier transform
About this lesson
A Fourier series needs a signal that repeats. The Fourier transform handles any signal, even one pulse. Watch it measured the way the formula reads: multiply a 1 V, 1 ms pulse by a test wave cos(2πft), add up the area, and you have X(f) at that frequency. Sweep f and the spectrum X(f) = sin(πfτ)/(πf) appears, with its zeros every 1 kHz. Then see why the sine part vanishes, rebuild the pulse with the inverse transform, compute X(500 Hz) = 0.637 V·ms with numpy, and find that a shorter pulse has a wider spectrum. It builds on the Fourier series lesson, the Circuits lessons on sinusoids and phasors, and complex exponentials.
One pulse that never repeats
A generator makes one pulse: 1 V for 1 ms, centred on t = 0, and zero at every other time. It never repeats, so it has no period, and a Fourier series cannot describe it. The Fourier transform can.
x(t) = 1 V for |t| < τ/2
0 elsewhere
τ = 1 ms (the pulse width)
periodic signal -> Fourier series:
lines at f0, 2·f0, 3·f0 ...
one pulse -> no period, no f0
-> the Fourier transformRead the lesson step by step
One pulse that never repeats
A generator makes one pulse: 1 V for 1 ms, centred on t = 0, and zero at every other time. It never repeats, so it has no period, and a Fourier series cannot describe it. The Fourier transform can.
x(t) = 1 V for |t| < τ/2 0 elsewhere τ = 1 ms (the pulse width) periodic signal -> Fourier series: lines at f0, 2·f0, 3·f0 ... one pulse -> no period, no f0 -> the Fourier transformStretch the period: lines become a curve
Repeat the pulse every T (the copies sit off this plot). Its Fourier series has lines at k/T; c_k, the series coefficient, is line k's amplitude. Stretch T from 2 to 8 ms: lines crowd closer, but T·c_k stays on one curve.
pulse repeated every T: lines at f = k/T (k = 0, ±1, ±2 ...) spacing 1/T T·c_k = X(k/T) (Oppenheim & Willsky §4.1) T = 2 ms -> lines every 500 Hz T = 8 ms -> lines every 125 Hz T -> ∞ -> a continuous curve X(f)Pick a frequency: a test wave
To measure one frequency, an oscillator makes a test wave cos(2πft). Turn f up from 0 to 500 Hz: the flat line starts to wave, and ends up finishing one cycle every 2 ms.
test wave c(t) = cos(2π·f·t) f = 0 Hz c(t) = 1 (flat) f = 500 Hz period 1/f = 2 ms the question for each f: how much of this wave is in x(t)? (sinusoids: Circuits, "Sinusoids")Multiply, instant by instant
Multiply the pulse by the test wave at every instant. Outside the pulse the product is 0. Inside it the pulse is 1 V, so the product is just the test wave, cut down to 1 ms.
p(t) = x(t) · cos(2π·f·t) |t| > 0.5 ms: x = 0 -> p = 0 |t| < 0.5 ms: x = 1 -> p = cos(2π·f·t) f = 500 Hz: p(0) = 1·cos(0) = 1 p(0.5 ms) = 1·cos(π/2) = 0Add up the area: one value of X(f)
Now add up the area under the product, from left to right. At 500 Hz it is all positive and totals 2/π ≈ 0.637 V·ms. That area is the transform at this one frequency: X(500 Hz) = 0.637 V·ms.
X(f) = ∫ x(t)·cos(2π·f·t) dt = ∫ from −0.5 to 0.5 ms of cos(2π·f·t) dt = sin(π·f·τ) / (π·f) f = 0.5 kHz, τ = 1 ms: sin(π/2) / (π·0.5) = 2/π = 0.637 V·ms units: volts × millisecondsWhen the areas cancel
Raise f to 1000 Hz. Now exactly one cycle fits inside the pulse. The negative area (red) grows until it cancels the positive area, and the total falls to 0. So X(1000 Hz) = 0: this pulse holds no 1000 Hz at all.
f = 1000 Hz: period 1 ms = the pulse width positive area (t near 0) +0.318 negative area (both ends) −0.318 total X(1 kHz) 0 zero again at 2, 3, 4 ... kHz: 2, 3, 4 ... whole cycles fitSweep f: the spectrum appears
Let f glide from −3 to +3 kHz and plot every area. The points join into X(f) = sin(πfτ)/(πf): tallest at 0 Hz, where it equals the pulse's area, 1 V·ms, and zero at ±1, ±2 and ±3 kHz.
X(f) = sin(π·f·τ) / (π·f), τ = 1 ms X(0) = 1.000 V·ms (area of x) X(500 Hz) = 0.637 X(1 kHz) = 0 X(1.5 kHz) = −0.212 (negative lobe) X(2 kHz) = 0 X(−f) = X(f): negative frequencies come from e^(−j2πft) (see complex exponentials)The full recipe: e^(−j2πft)
The full recipe is X(f) = ∫ x(t)·e^(−j2πft) dt. Since e^(−j2πft) = cos(2πft) − j·sin(2πft), there is a sine test wave too. This pulse is symmetric about t = 0, so every sine area cancels and X(f) is real.
X(f) = ∫ x(t)·e^(−j2πft) dt e^(−j2πft) = cos(2πft) − j·sin(2πft) (Euler) X(f) = ∫ x·cos dt − j·∫ x·sin dt real part imaginary part x(−t) = x(t), sin(−u) = −sin(u): the sine areas cancel, ∫ x·sin dt = 0 so X(f) is a real number hereBack again: the inverse transform
Going back, x(t) = ∫ X(f)·e^(j2πft) df rebuilds the signal. Keep |f| < B and widen B to 3 kHz: the sum sharpens into the pulse. The edge overshoot never dies away: it settles near 9 % of the jump (Gibbs); here 11 %.
x(t) = ∫ X(f)·e^(+j2πft) df (inverse) keep only |f| < B: x_B(t) = (1/π)·[Si(2πB(t+τ/2)) − Si(2πB(t−τ/2))] B grows -> ripples get narrower; the peak overshoot swings (both edges add): 18 % at 1 kHz, 4 % at 1.5 kHz, 11.0 % at 3 kHz of the 1 V jump -> 8.95 % as B -> ∞, never -> 0 (Gibbs) X(f) and x(t): two views of one signalIn Python: the integral becomes a sum
A computer replaces the integral by a sum. With numpy, take t in steps of 1 µs, multiply x by np.exp(−2j·np.pi·f·t), add with np.sum and multiply by the step. At 500 Hz it gives 0.6366 V·ms.
import numpy as np dt = 1e-6 # 1 µs t = (np.arange(-2000, 2000) + 0.5) * dt x = 1.0 * (np.abs(t) < 0.5e-3) # 1 V, 1 ms f = 500 X = np.sum(x * np.exp(-2j*np.pi*f*t)) * dt print(round(X.real * 1e3, 4)) # V·ms >>> 0.6366 (imaginary part about 0; exact 2/π = 0.63662)Shorter pulse, wider spectrum
Halve the pulse to 0.5 ms. The spectrum gets lower (X(0) = 0.5 V·ms) and twice as wide: the first zero moves from 1 to 2 kHz. Shorter in time means wider in frequency: a sharp click holds many frequencies.
first zero at f = 1/τ τ = 1 ms -> 1 kHz, X(0) = 1 V·ms τ = 0.5 ms -> 2 kHz, X(0) = 0.5 V·ms width in time × width in frequency stays the same (τ · 1/τ = 1) next: shift, scale and convolution
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01Why can a single pulse not be described by a Fourier series?
A Fourier series uses harmonics of the fundamental frequency 1/T, which needs a period T. Letting T grow without end turns the lines into the continuous transform X(f). Sharp edges are fine: a square wave has a Fourier series.
02A 1 V pulse lasts 1 ms. What is X(0), the value of its spectrum at 0 Hz?
At f = 0 the test wave is cos(0) = 1, so X(0) = ∫ x(t) dt, the pulse's area: 1 V × 1 ms = 1 V·ms.
03For the 1 ms pulse, why is X(1 kHz) = 0?
The product equals cos(2π·1000·t) over the 1 ms pulse: one full cycle, whose positive area (+1/π V·ms) and negative area (−1/π V·ms) cancel. The spectrum is non-zero again between 1 and 2 kHz.
04The pulse is shortened from 1 ms to 0.25 ms. Where is the first zero of X(f) now?
X(f) = sin(πfτ)/(πf) is first zero at f = 1/τ = 1/0.25 ms = 4 kHz. A shorter pulse has a wider spectrum.
05In numpy, which line approximates X(f) for samples x at times t, spaced dt apart?
The integral ∫ x(t)·e^(−j2πft) dt becomes a sum of x·e^(−j2πft) over the samples, times the step dt. np.exp accepts the complex argument −2j·π·f·t.
Glossary
- Fourier transform
- X(f) = ∫ x(t)·e^(−j2πft) dt: for each frequency f, how much of that frequency the signal x(t) contains, as a (generally complex) number.
- Spectrum
- The transform X(f) seen as a function of frequency: the frequency-domain view of a signal.
- Inverse Fourier transform
- x(t) = ∫ X(f)·e^(j2πft) df: rebuilds the signal from its spectrum, so nothing is lost by transforming.
- Test wave
- Here, the cosine (and sine) at frequency f that the signal is multiplied by; the area of the product is the transform at f.
- Rectangular pulse
- A signal that is constant for a time τ and zero elsewhere; its transform is sin(πfτ)/(πf), a sinc shape.
- Sinc
- The shape sin(πu)/(πu): 1 at u = 0 and zero at every other whole number u.
- Gibbs phenomenon
- The overshoot near a jump when a signal is rebuilt from a limited band of frequencies. Widening the band does not remove it: it settles near 9 % of the jump.
- Negative frequency
- f < 0 in X(f). A real cosine needs both +f and −f, since cos(2πft) = (e^(j2πft) + e^(−j2πft))/2. For a real signal X(−f) is the complex conjugate of X(f).
Notes and sources
- The pulse (1 V, 1 ms) and the test frequencies are chosen examples. Frequencies are in hertz, f = 1/period, and X(f) is in volt-milliseconds (V·ms). Every curve and value in the figure is computed from this model.
- The multiplier and area adder are a way to picture the integral, not a lab instrument. A real spectrum analyser or a computer's FFT gets the same numbers by other means; the DFT and FFT have their own lessons.
- Rebuilt from the band |f| < B, the pulse overshoots near its edges. As B grows the overshoot does not die away: it settles near 9 % of the jump (0.0895 of it) instead of going to zero; here it is 11.0 % at B = 3 kHz. This is the Gibbs phenomenon. Widening B squeezes the ripples closer to the edges.
- A. V. Oppenheim, A. S. Willsky, S. H. Nawab, Signals and Systems, 2nd ed., Pearson (ch. 4: The Continuous-Time Fourier Transform)
- B. P. Lathi, R. A. Green, Linear Systems and Signals, 3rd ed., Oxford University Press, 2018 (Internet Archive record)
- MIT OpenCourseWare 6.003 Signals and Systems, Fall 2011: lecture notes (lecture 15 Fourier Series, lecture 16 Fourier Transform)
- MIT OpenCourseWare RES.6-007 Signals and Systems (A. V. Oppenheim)
- Fourier transform (Wikipedia): definition with ordinary frequency and the inverse transform
- Rectangular function (Wikipedia): its Fourier transform is sin(πf)/(πf)
- Gibbs phenomenon (Wikipedia): overshoot of about 9 % of the jump, also for a truncated Fourier integral
- NumPy documentation: numpy.exp (complex arguments)
- NumPy documentation: numpy.sum
- NumPy documentation: numpy.arange
Quiz Unlocks after the last step.