Harmonics series · Part 2

Why do we see harmonics?

A mathematical answer, with functions you can check yourself. This is the full version of the LinkedIn carousel.

October 2026 · 10 min read · interactive

The carousel

Slide 1: Why do we see harmonics? Slide 2: Start with one assumption, f(t+T)=f(t) Slide 3: Which sines and cosines are allowed? Slide 4: The Fourier series Slide 5: Example 1, a pure sine Slide 6: Example 2, a square wave Slide 7: Why only odd? Symmetry Slide 8: Example 3, a sawtooth Slide 9: Example 4, a triangle wave Slide 10: Sharper shape, more harmonics Slide 11: Example 5, cut a sine on one side Slide 12: Example 6, a real machine signal Slide 13: Where harmonics are born, nonlinearity Slide 14: What the FFT actually computes Slide 15: What this means for the analyst Slide 16: Sources and further reading Slide 17: Now watch them come apart

Scroll sideways · tap a slide to enlarge · open the PDF

Try it: build a signal from its harmonics

Pick a shape, then add harmonics one at a time. The solid line is the sum so far, the dashed line is the shape you are aiming for, and the spectrum shows each harmonic's amplitude (faded bars are the ones you haven't added yet).

Time: two periods
Spectrum: amplitude of each harmonic
Energy captured:

The argument in seven steps

1. One assumption

A machine at constant speed produces motion that repeats every revolution. Mathematically the signal is periodic, with period \(T\) (one revolution):

$$f(t+T) = f(t), \qquad \omega_0 = \frac{2\pi}{T}$$

Nothing is assumed about the shape: smooth, flattened, spiky or lopsided. Only that it repeats.

2. Only whole multiples fit

If a sine or cosine at frequency \(\omega\) is part of that signal, it has to repeat after \(T\) as well:

$$\sin\big(\omega(t+T)\big) = \sin(\omega t) \;\Rightarrow\; \omega T = 2\pi n \;\Rightarrow\; \omega = n\,\omega_0,\quad n = 1,2,3,\dots$$

Harmonics sit at exact integer multiples of running speed, not by convention, but because nothing else fits.

3. The Fourier series

Fourier (1822) showed that any reasonable periodic function is a sum of exactly those allowed sines and cosines:

$$f(t) = a_0 + \sum_{n=1}^{\infty}\Big[a_n\cos(n\omega_0 t) + b_n\sin(n\omega_0 t)\Big]$$

Each coefficient measures how much the signal looks like that harmonic, a projection over one period:

$$a_n = \frac{2}{T}\int_0^T f(t)\cos(n\omega_0 t)\,dt, \qquad b_n = \frac{2}{T}\int_0^T f(t)\sin(n\omega_0 t)\,dt$$

The peak at \(n\)X on your spectrum is \(|c_n| = \sqrt{a_n^2 + b_n^2}\). That is all a harmonic is.

4. Worked examples

ShapeSeriesWhat you see
Pure sine\(\sin(\omega_0 t)\)One peak at 1X
Square\(\frac{4}{\pi}\sum_{n\ \text{odd}}\frac{\sin(n\omega_0 t)}{n}\)Odd only, 1.27, 0.42, 0.25, … (falls as \(1/n\))
Sawtooth\(\frac{2}{\pi}\sum_{n}(-1)^{n+1}\frac{\sin(n\omega_0 t)}{n}\)Every harmonic, 0.64, 0.32, 0.21, … (\(1/n\))
Triangle\(\frac{8}{\pi^2}\sum_{n\ \text{odd}}(-1)^{\frac{n-1}{2}}\frac{\sin(n\omega_0 t)}{n^2}\)Odd only, falls as \(1/n^2\): 3X is 1/9 of 1X
Sine cut on one side\(\frac{1}{\pi}+\frac{1}{2}\sin\omega_0 t-\frac{2}{\pi}\sum_{n\ \text{even}}\frac{\cos(n\omega_0 t)}{n^2-1}\)1X plus even harmonics, and a DC offset of \(1/\pi\)

5. Symmetry decides odd vs even

A square wave has half-wave symmetry: the second half-cycle is the first one flipped upside down, \(f(t+T/2) = -f(t)\). Shift an even harmonic by half a period and it lands on itself:

$$\sin\big(n\omega_0(t + T/2)\big) = \sin(n\omega_0 t + n\pi) = +\sin(n\omega_0 t)\quad (n\ \text{even})$$

It doesn't flip, so it can't help build a shape that does: its coefficient is forced to zero. Odd harmonics flip, so they survive. Symmetric distortion gives odd harmonics only; break the symmetry and the evens appear.

6. Sharpness decides how far they extend

Integrate the coefficient formula by parts and each step pulls out a factor \(1/n\), until you hit a discontinuity. So a jump in the waveform gives harmonics that decay like \(1/n\), a corner gives \(1/n^2\), and smoother shapes decay faster still. Sharp features in time live at high frequency, which is why impacts push energy far up the harmonic series.

7. Where harmonics are born: nonlinearity

A linear system driven at \(\omega_0\) responds only at \(\omega_0\). Harmonics need a response that isn't proportional to the input. Two identities you can check by hand:

$$\sin^2\omega_0 t = \tfrac12 - \tfrac12\cos 2\omega_0 t, \qquad \sin^3\omega_0 t = \tfrac34\sin\omega_0 t - \tfrac14\sin 3\omega_0 t$$

A squared (asymmetric) term creates 2X and a DC shift; a cubed (symmetric) term creates 3X. Clearances, impacts and stiffness that differs in each direction are all nonlinearities, which is why looseness and rubs show harmonic families.

Real signals

A real machine signal has no neat formula: some imbalance, some misalignment, an impact every revolution that rings and decays. But it still repeats, so it is still a Fourier series. Imbalance lands on 1X, misalignment on 2X, and the ringing impact spreads energy across 4X–7X. Select Real machine in the builder above to see it.

If something repeats and isn't a pure sine, you will see harmonics. They aren't extra signals: they're the shape of one repeating motion, written as sines and cosines.

A note on the FFT

Your analyser doesn't see a formula, it sees samples. If the record holds a whole number of periods, harmonic \(n\) lands exactly on an FFT bin and \(\tfrac{2}{N}|X[k]|\) equals \(|c_n|\): the same numbers as the series. Two things break that in practice: leakage (a non-integer number of periods smears peaks into neighbouring bins; a window such as Hanning controls it) and aliasing (harmonics above half the sample rate fold back to false frequencies; anti-alias filtering prevents it). Before blaming the machine, rule out the measurement: a saturated sensor, a loose mount or a clipped input range also distort the waveform and create harmonics.

Check it yourself

The script below compares every series on this page with an FFT of the same function. The largest difference is about \(10^{-4}\), from sampling the jumps.

python verify_harmonics.py

function                                         n      FFT  formula
square     sgn(sin w0 t)                         1   1.2732   1.2732
                                                 3   0.4244   0.4244
                                                 5   0.2546   0.2546
...

Downloads

Sources and further reading

← Part 1: What the FFT shows Part 3, the video, coming soon