Lesson goal: Harmonics and musical timbre

Previous: Acoustic beats | Home | Next: Musical scales and equal temperament

Why does a violin, a clarinet, and a flute playing the exact same note (like A3 at $220\text{ Hz}$) sound completely different?

The answer is timbre (often called tone color or sound quality). Timbre is produced by harmonics (overtones).

When an acoustic instrument plays a note, the vibrating string or air column doesn't just vibrate in one simple wave. It vibrates in multiple modes simultaneously at integer multiples of its lowest frequency, known as the fundamental frequency $f_0$: $$f_n = n \cdot f_0 \quad (n = 1, 2, 3, 4, 5, \dots)$$
  • $n = 1$: Fundamental frequency ($f_0$) — sets the main musical pitch you recognize.
  • $n = 2$: 2nd harmonic ($2 f_0$) — exactly one octave higher.
  • $n = 3$: 3rd harmonic ($3 f_0$) — an octave plus a musical fifth.
  • $n = 4$: 4th harmonic ($4 f_0$) — two octaves higher.
In the early 1800s, French mathematician Joseph Fourier made a profound discovery: any continuous periodic sound wave can be constructed by adding together pure sine waves of harmonic frequencies: $$y(t) = \sum_{n=1}^{N} A_n \sin(2\pi \cdot n f_0 \cdot t)$$ By choosing different recipes of amplitudes $A_n$, we can synthesize the characteristic sounds of entire families of musical instruments:
  • Pure Tone (tuning fork): Only the fundamental ($n=1$). Very smooth and plain.
  • Sawtooth Wave (violin, cello, bright brass): Contains all harmonics ($n = 1, 2, 3, 4, \dots$) with amplitude $A_n = 1/n$. Bright, buzzy, and full.
  • Square Wave (clarinet, oboe, vintage 8-bit synths): Contains only odd harmonics ($n = 1, 3, 5, 7, \dots$) with amplitude $A_n = 1/n$. Hollow and reedy.
  • Triangle Wave (flute, recorder): Contains only odd harmonics with rapidly falling amplitudes ($A_n = 1/n^2$). Soft and breathy.
s = {}
for n = 1, 10 do

amp = 1 / n

freq = n * 220

table.insert(s, amp)

table.insert(s, freq)

end

play_sines(s, 3)
Move the mouse over a dotted box for more information.

  • Acoustic Physics: Instruments open at both ends (like flutes) or strings anchored at both ends (like violins and guitars) form standing waves with nodes at both ends: $L = n \frac{\lambda}{2}$. This produces all integer harmonics ($n = 1, 2, 3, \dots$).
  • Pipes Closed at One End: Instruments like the clarinet or pan pipes are closed at the mouthpiece and open at the bell. They have a node at one end and an antinode at the other: $L = (2m - 1)\frac{\lambda}{4}$, which naturally produces only odd harmonics ($n = 1, 3, 5, \dots$). This gives them their uniquely hollow acoustic signature!

Now you try. Run the code with $N = 1$, then $N = 3$, and $N = 12$. Notice how each added harmonic introduces more brightness and acoustic warmth!

Type your code here:


See your results here: