Sub topic 13
Harmonics and Building Complex Waveforms
Assume you know basic trigonometry, amplitude, wavelength, frequency, period, wave speed, and the relation \(v=f\lambda\). This chapter applies superposition to periodic waves that are more complicated than a single sine wave.
Harmonics and the fundamental frequency
A harmonic is a sinusoidal component whose frequency is an integer multiple of a fundamental frequency. The fundamental is the lowest repeating frequency, written \(f_0\). The \(n\)-th harmonic has frequency
\[ fn=nf0 \]
For example, if \(f_0=100\text{ Hz}\), the second harmonic is \(200\text{ Hz}\), the third is \(300\text{ Hz}\), and so on.
A periodic waveform can contain the fundamental, higher harmonics, and possibly a constant offset. Its Fourier representation is
\[ y(t)=y{\text{DC}}+\sum{n=1}^{\infty} An\sin(2\pi n f0t+\phi_n) \]
Here, \(An\) is the amplitude of harmonic \(n\), and \(\phin\) is its phase. The DC term, \(y_{\text{DC}}\), shifts the entire waveform up or down.
The waveform's shape depends on the amplitudes and phases of its harmonics:
| Waveform feature | Harmonic content |
|---|---|
| Pure sine wave | One harmonic, usually the fundamental |
| Square-like waveform | Strong odd harmonics |
| Complex periodic waveform | Several harmonics with different amplitudes and phases |
Fourier synthesis
Fourier synthesis means adding sinusoidal components to build a target waveform. For a symmetric square wave, an ideal mathematical model is
\[ y(t)=\frac{4A}{\pi}\left[ \sin(\omega0t)+\frac{1}{3}\sin(3\omega0t)+\frac{1}{5}\sin(5\omega_0t)+\cdots \right] \]
Only odd harmonics appear. The amplitude of each included harmonic decreases as \(1/n\). Adding more terms makes the flat sections more accurate and the transitions sharper.
The transition near a square-wave edge still produces a small overshoot when only a finite number of harmonics is used. This is called the Gibbs phenomenon. Adding more harmonics makes the overshoot narrower, but does not remove its approximate height.
A numerical example
The following program adds the first four odd harmonics of a square wave. Each term has the coefficient \(4/(\pi n)\).
import numpy as np
f0 = 3.0
t = np.linspace(0, 1, 1000, endpoint=False)
y = np.zeros_like(t)
for n in (1, 3, 5, 7):
coefficient = 4 / (np.pi * n)
y += coefficient * np.sin(2 * np.pi * n * f0 * t)
print("Harmonic amplitudes:")
for n in (1, 3, 5, 7):
print(f"{n}f0: {4 / (np.pi * n):.3f}")
print(f"Approximate maximum value: {y.max():.3f}")The result is not a perfect square wave because only four components are present. The fundamental controls the overall repetition rate. The higher harmonics control details such as sharp edges.
Reading a waveform's spectrum
A spectrum displays the amplitude of each frequency component. A single-frequency sine wave has one spectral line. A complex periodic waveform has several lines at integer multiples of \(f_0\). The spectrum is often easier to analyze than the time-domain shape because it directly shows which harmonics are present.
A common error is to confuse harmonic number with amplitude. The fifth harmonic has frequency \(5f_0\), but its amplitude can be smaller, equal to, or larger than another harmonic depending on the physical system.
Exercise
A waveform uses the first, third, and fifth harmonics of a 200 Hz fundamental. What are their frequencies?
Show answer
The frequencies are 200 Hz, 600 Hz, and 1000 Hz.