Explainers · FFT series · Part 2

Leakage and aliasing: the FFT's two traps

November 2026 · 3 min 26 s video, with sound · interactive

The video from the LinkedIn post. No voice: captions are on screen, and the sound includes a tone you can hear aliasing.

What the video shows. An FFT works on one short record of the signal and treats it as if it repeated forever. A tone that fits the record a whole number of times lands in one bin. A tone that doesn't fit spills into every bin: that is leakage, and a window reduces it. Separately, a tone above half the sample rate is recorded as a lower frequency: that is aliasing, and the fix is to sample faster and filter first.

TRAP 1

Leakage

A tone between two bins smears across all of them. Fix: window it.

TRAP 2

Aliasing

A tone above half the sample rate shows up somewhere else. Fix: sample faster, filter first.

One record, repeated forever

An analyser never sees your whole signal. It takes one record, \(N\) samples long, and the maths of the FFT assumes that record repeats end to end. Both traps come from that one assumption.

The bins of an FFT sit at whole numbers of cycles per record:

$$f_k=k\,\frac{f_s}{N},\qquad k=0,1,2,\dots$$

where \(f_s\) is the sample rate. In the video each bin is a lane, and only tones with exactly 1, 2, 3… cycles in the record have a lane of their own.

Trap 1: leakage

A tone with exactly 4 cycles in the record lands in bin 4 and nowhere else. Give it 4.5 cycles and there is no bin for it, so its energy spreads over all of them. For a tone of amplitude \(A\) with \(f\) cycles in the record, the bins read approximately

$$|X_k|\approx A\left|\frac{\sin\pi(k-f)}{\pi(k-f)}\right|.$$

When \(f\) is a whole number this is \(A\) in one bin and zero in the rest. Halfway between two bins, the two nearest bins each read about 64% of \(A\), and the rest fall away only slowly.

Why it leaks: the seam

Repeat a record that holds 4.5 cycles and the end doesn't meet the start: \(x(0)=A\) but \(x(T)=A\cos(2\pi\cdot4.5)=-A\). Every seam has a jump, and a jump is sharp. As the harmonics series showed, a sharp edge needs many frequencies to build. Those extra frequencies are the leaked bins.

Try it

Leakage board · 64 samples per record

The record, repeated three times (the seams are marked)

The spectrum the FFT reports

Jump at the seam: 0Tallest bin: 0 of ALargest far bin (9 to 12): 0 dB

Slide to a whole number and the seams close and the spectrum collapses to one bar. Switch the window on at 4.5 and watch the far bins drop.

The fix: a window

A window fades the record in and out so both ends meet at zero. The most common one in vibration work is the Hann (Hanning) window:

$$w[n]=\tfrac12\left(1-\cos\frac{2\pi n}{N}\right).$$

With no jump at the seam, the leak stays close to the true frequency. In the video's example (4.5 cycles, 64 samples), the largest of the far bins 9 to 12 drops from about −17 dB to about −47 dB relative to the peak.

The price is a slightly wider peak, because the window itself has a spectrum. A window also lowers the reading, so analysers multiply the result back up: by 2 for the amplitude of a Hann-windowed tone. For general machine spectra that trade is almost always worth it. When you need the most accurate amplitude of a single tone, a flat-top window is the usual choice; for a transient that fits inside the record, such as a hammer impact, use no window (or a force/exponential pair).

Derive both leakage formulas and the ×2 correction line by line, then work a pump signal on a calculator, in Lab lesson 5: Leakage and windows.

Trap 2: aliasing

Leakage smears a frequency. Aliasing moves it somewhere else entirely.

Picture a point on a shaft turning 11 times a second, sampled 12 times a second. Between two samples it turns 11/12 of a turn forward, which looks exactly like 1/12 of a turn backward. The samples show a shaft turning slowly backward, once a second:

$$\sin\!\left(2\pi\cdot11\cdot\tfrac{n}{12}\right)=-\sin\!\left(2\pi\cdot\tfrac{n}{12}\right).$$

In the spectrum, everything above half the sample rate folds back, like paper folded at \(f_s/2\). A tone at \(f\) is seen at

$$f_{\text{seen}}=\left|\,f-f_s\cdot\operatorname{round}\!\left(\frac{f}{f_s}\right)\right|,\qquad |11-12|=1\ \text{Hz}.$$

Once it has been sampled, an aliased tone is indistinguishable from a real one at that frequency. No processing afterwards can remove it.

The fix: sample fast enough, and filter first

Sample faster than twice the highest frequency present (the Nyquist rule):

$$f_s>2\,f_{\max}.$$

At 24 samples a second each step of the 11 Hz shaft is less than half a turn, and the samples follow the real motion.

But you rarely control what is in the signal. Noise at 15 Hz, sampled at 12 Hz, folds to \(15-12=3\) Hz and lands on top of a real 3 Hz component. So an analyser puts an analogue low-pass filter, the anti-alias filter, before the sampler to remove everything above \(f_s/2\).

In practice: a real filter can't cut off instantly, so vibration analysers sample at about 2.56 times the top frequency you ask for, not 2. That is why a 400-line spectrum comes from 1,024 samples. If you set up a data acquisition system yourself, check that its anti-alias filter is on and suits the sample rate.

Downloads

Further reading