[Physics] Why are the harmonics of a piano tone not multiples of the base frequency

acousticsstringwaves

I was trying to figure out which piano keys were being played in an audio recording using spectral analysis, and I noticed that the harmonics are not integer multiple of the base note. What is the reason for this?


Take a look at the spectrogram of a clean sample from a single piano key. I am using Piano.ff.A4 from here.

enter image description here

The following is the same as above, with a superimposed reference grid of $ 440 ~\mathrm{Hz}$. As you can see, the harmonics have increasingly higher frequencies than integer multiples of $440 ~\mathrm{Hz}$.

enter image description here

At this point you might think that the actual base frequency is just slightly higher than $440 ~\mathrm{Hz}$. So let us make a different reference grid, which lines up with the harmonic at ~$5060 ~\mathrm{Hz}$.

enter image description here

You can now clearly see that they aren't actually integer multiples of a base frequency.

Question: What is the explanation for this? I am looking both for simple high-level explanations of what is happening, and more in-depth, instrument specific ones, which could maybe allow me to attempt to calculate the harmonics.

My first reaction was that this must be some non-linear effect. But you can see that the harmonics do not change frequency at all as time passes and the sound gets quieter. I would expect a non-linear effect to be pronounced only in the loudest part of the sample.


Update – I measured the frequencies using peak detection on the Fourier transform from 0.3 to 0.4 seconds in the sample. This table compares the measured values with integer multiples of 440:

meas.   int. mult.
440.    440.
880.    880.
1330.   1320.
1780.   1760.
2230.   2200.
2680.   2640.
3140.   3080.
3610.   3520.
4090.   3960.
4570.   4400.
5060.   4840.
5570.   5280.

Best Answer

This effect is known as inharmonicity, and it is important for precision piano tuning.

Ideally, waves on a string satisfy the wave equation $$v^2 \frac{\partial^2 y}{\partial x^2} = \frac{\partial^2 y}{\partial t^2}.$$ The left-hand side is from the tension in the string acting as a restoring force.

The solutions are of the form $\sin(kx - \omega t)$, where $\omega = kv$. Applying fixed boundary conditions, the allowed values of the wavenumber $k$ are integer multiples of the lowest possible wavenumber, which implies that the allowed frequencies are integer multiplies of the fundamental frequency. This predicts evenly spaced harmonics.

However, piano strings are made of thick wire. If you bend a thick wire, there's an extra restoring force in addition to the wire's tension, because the inside of the bend is compressed while the outside is stretched. One can show that this modifies the wave equation to $$v^2 \frac{\partial^2 y}{\partial x^2} - A \frac{\partial^4 y}{\partial x^4} = \frac{\partial^2 y}{\partial t^2}.$$ Upon taking a Fourier transform, we have the nonlinear dispersion relation $$\omega = kv \sqrt{1 + (A/v^2)k^2}$$ which "stretches" evenly spaced values of $k$ into nonuniformly spaced values of $\omega$. Higher harmonics are further apart. We can write this equation in terms of the harmonic frequencies $f_n$ as $$f_n \propto n \sqrt{1+Bn^2}$$ which should yield a good fit to your data. Note that the frequencies have no dependence on the amplitude, as you noted, and this is because our modified wave equation is still linear in $y$.

This effect must be taken into account when tuning a piano, since we perceive two notes to be in tune when their harmonics overlap. This results in stretched tuning, where the intervals between the fundamental frequencies of different keys are slightly larger than one would expect. That is, a piano whose fundamental frequencies really were tuned to simple ratios would sound out of tune!