A signal with no period
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.
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.
Measuring one frequency
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.
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.
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.
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.
The whole spectrum
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.
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.
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 %.
In code, and a rule of thumb
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.
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.
The working
# step 1/11 · pulse
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 transform
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.