Harmonic

Harmonic

A harmonic is a sinusoidal component of a signal whose frequency is an integer multiple of a fundamental frequency. If the fundamental frequency is $f_0$, then the harmonics are at $2f_0, 3f_0, 4f_0, ...$

A square wave contains only odd harmonics — $3f_0, 5f_0, 7f_0$ — with amplitudes decreasing as $1/n$. The plot above shows how adding these harmonics progressively reconstructs a square wave. The fundamental (orange dotted) is the lowest frequency. Adding the 3rd harmonic (green), 5th (red), and 7th (purple) makes the waveform increasingly square-like.

In digital signal processing, harmonics appear naturally in many contexts:

  • Periodic signals — any periodic signal can be expressed as a sum of harmonics (Fourier series).
  • Non-linear distortion — when a signal passes through a non-linear system, new harmonics are generated (harmonic distortion).
  • Power systems — harmonics in AC mains cause interference and heating (power quality).
  • Musical acoustics — the harmonic structure determines the character of an instrument.

The first harmonic is the fundamental itself. The second harmonic is twice the frequency, the third is three times, and so on. A pure sine wave has only the first harmonic — no overtones.

For those wondering why the higher harmonics have a smaller amplitude — it is not accidental. The amplitude of each harmonic is determined by the shape of the waveform. For a square wave, the Fourier series coefficients decay as $1/n$, where $n$ is the harmonic number. This means the 3rd harmonic has one‑third the amplitude of the fundamental, the 5th has one‑fifth, and so on. This decay is a direct consequence of the sharp edges of the square wave — the sharper the transition, the more high‑frequency content is required, but each successive harmonic contributes less energy.

Different waveforms have different decay rates. A triangle wave decays as $1/n^2$ (faster), while a sawtooth wave decays as $1/n$ (like the square wave). These patterns are universal — they follow from the mathematics of the Fourier series, and they determine how a signal sounds, how it behaves in a circuit, and how it is processed digitally.