# What is the explanation for higher harmonics not being integral multiples of the fundamental?

Looking at this file of a A4 note from a piano, I get this spectrogram (simply using Python code performing a FFT): Piano A4 spectrum with harmonics values assuming a 440 Hz tuning

I'm trying to understand it (I'm not an expert in harmony). The vertical lines are the locations expected for the harmonics. We see the A4 fundamental at 440 Hz, then the first 4 harmonics of this A4 in decreasing amplitude at the correct locations, so far, so good.

After this, the peaks are continuously sliding from their expected locations, so it rather seems there is a new note at about 2670 Hz, closest are A4 6th harmonics (2640) and E7 tuning (2637), followed by what looks like its two shifted harmonics, the process repeats at about 4000 Hz. I think it's a new note rather than an harmonics because its amplitude exceeds the neighboring harmonics (not sure I'm right).

I can't get the sense of that.

Another attempt with A4 tuned at 458 Hz to have the 11th harmonics matching, this time other peaks don't align with their expected frequencies: Piano A4 spectrum with harmonics values assuming a 458 Hz tuning

Update: I did this analysis to compare timbres from a tuning fork and from different instruments and detect possible procedural errors. In addition of the previous piano (which maybe a digital one), I got a Steinway sample, and also a sax to verify @ttw 's explanation (verified): Comparing different instruments using the same tool-chain (tuning fork, piano, piano, sax)

Another explanation could be the E7 string starts resonating with the A4, can someone shed some light on this? Is this usual?

• That could depend on various aspects, including some resonance of the room, but it's likely that your assumption about the E7 string is correct: remember that the higher notes of a piano don't have any dampers (usually they are the last 18-20 notes). Mar 19 at 15:04
• @musicamante: Thanks, that's interesting. Are the notes of the last octaves (of a piano) tuned as exact multiples of the, say, 3rd octave (I mean are the comma issue or the temperament playing a role)
– mins
Mar 19 at 15:10
• That depends. Piano tuners generally "stretch" octaves, with higher notes a bit higher than lower ones (see stretched tuning). Mar 19 at 15:14
• Seems also to me that the shift gradually increases. If the fundamental is not at 440Hz sharp, but at 441Hz, the 10th harm will be at 4410 and not 440. Maybe getting the maxima of this spectrum as a list would be useful to check that.
– Tom
Mar 19 at 15:15
• It would be interesting to see a second graph made after covering the undamped strings with something to damp them. That would clarify whether or not they are influencing the initial graph. Mar 19 at 19:16

The harmonic series, 1, 1/2, 1/3, 1/4,... only agrees with the physics for thin low-tension strings. A piano (even at the top) has relatively thick, high-tension strings. The harmonics tend to get sharper. There's a formula taking into account thickness and tension. Basically, the higher frequencies are raised by the square root of the tension over the density.

https://en.wikipedia.org/wiki/String_vibration From some requests, I've added supplements. (I left out the mechanism of inharmonicity; it comes from the stiffness of the string as discussed in the two references.)

Wiki has a summary: https://en.wikipedia.org/wiki/Inharmonicity

This paper shows in more detail the fourth-order differential equations governing the strings. http://www.simonhendry.co.uk/wp/wp-content/uploads/2012/08/inharmonicity.pdf

• I don't believe the quoted article in the wikipedia discusses inharmonicity at all. The factor of square root of tension over density is constant for each harmonic so it doesn't contribute to inharmonicity. Inharmonicity is related to string stiffness, which is related to its material, thickness, and also string length. Mar 19 at 17:38
• The point is that tension and density do cause the string's overtones not to match the harmonic ratios. (The same argument applies to Pythagaros' argument about ringing hammers which do not follow the series either.
– ttw
Mar 19 at 18:20
• Like @user1079505, I see no dependence on n in that factor, so that the predicted frequencies should just be multiples of the fundamental. Can you find another formula that predicts something else, or do a worked example to show how that formula predicts a 9th overtone that is not a multiple of the fundamental? I have added a plea for an explanation to the discussion page of that article. Mar 25 at 21:28
– mins
Mar 25 at 23:38

The explanation and understanding can be found in the physics of vibrating systems (and a little bit in basic definitions).

A harmonic series is defined by the relationship fn = n*f1m n = 1, 2, 3, ...

If f is a frequency, say 110Hz, then the harmonics are 220, 330, 440, ... etc.

A "simple" wave form or signal has a single frequency in it and is described by a trig function, sin(2 pi f t) or cos(2 pi f t). In this sequence the lowest frequency is called the fundamental. The set of all such functions can be used to describe almost any function which is quite amazing. In math we say that the set of all functions {sin(2 pi f t), cos(2 pi f t)} for a basis for a function space. Expanding any curve as an infinite series of these basic waves is the foundation of signal analysis or harmonic analysis and synthesis (the latter being the construction of a generic function by adding together sines and cosines).

In algebra the simplest function might be a straight line, having 2 parameters, a slope and intercept. So describing a line with an infinite series of sines would seem foolish. But in vibration and wave theory the simplest function is in fact a sine. The aforementioned functions are the simplest solution to the wave equation and describe a wave train of a single wavelength or frequency. In music this would be a single pitch, in optics it would be a single color (monochromatic).

Each such eave has three parameters that describe it, a frequency, an amplitude, and a phase. Frequency you know, amplitude is related to volume or power, and phase just tells you how the wave looks at t = 0 sec. Two waves with the same f and Amp but different phase are the exact same shape but shifted.

Now for the physics.

All continuous vibrating system, tight string, air column in a tube, stiff plates, etc have an infinite set of solutions to the basic wave equation characterized by the frequency (and some other parameters). Not all of these frequencies obey the harmonic sequence but the two that come very close are (1) the tight vibrating string, and (2) standing air waves in a long thin tube. These cover most of the instruments in an orchestra.

So, how do all these vibrations come into a single note? The presence of multiple harmonics in a single note plucked on a guitar for example are the result of the attack. The initial conditions that determine how the string is set in motion. The shape of a plucked string will not be a sine or cosine but can be described as an infinite series of these functions. So when you play a musical instrument including your voice you excite all these harmonics.

The harmonic relation is pretty simple and actually rare. Most real material systems, including strings, do NOT obey the simple wave equation but contain stiffness terms that are linear, but higher order. As a result vibrations in a stiff bar, or very tight short string plucked or hammered with enough force will exhibit non-harmonic over tones. I've done harmonic analysis on very long tuning forks back in college and you can easily tweak out an octave and an augmented 5th. In fact if you are a well trained musician you can hear it! And, since the lobe pattern is frequency dependent if you turn the fork you will hear different notes dominate the sound field at your ear. It's pretty cool.

I would never expect the "harmonics" of a musical instrument to truly follow the harmonic sequence due to the fact they do not obey ideal physics equations. There are some good sources that describe the corrections to the simple models. In particular anything by Fletcher and Rossing.

First of all- WOW! So interesting, I hope you come back here and do a lot more of these!

I think what's happening here is the difference between natural harmonics and equal temperament. If you can find a sample of someone playing the song in just temperament for a long time and then equal temperament, you might throw up. Not exaggerating, it's really quite jarring.

Let's start with the relationship between natural harmonics and equal-tempered notes to see if that's our cause: (from Wikipedia) So I don't think vibrating high strings are the culprit. If they were, then I'd expect a variety of reinforced harmonics due to sympathetic vibration, not an even drift. Even if a (human, I mean) tuner were deliberately sharpening upper notes due to some kind of psycho-acoustic effect, you'd still expect 7th harmonics to be way more off than say octave harmonics.

It seems to me, however, that being very slightly off in the primary pitch would lead to the effect you've found. Can you take your A440 example and compress the whole graph so that the 12th harmonic lines up properly? I think you'll just find that you've tuned to a 440.1 or something.

• What's the actual source for the natural/equal-tempered pitches? The Wikipedia link just points to the image. Mar 19 at 19:50
• Look at the answer from my comment by the OP under the question, he tried starting from another frequency (445) but not everything matches. Furthermore, equal temperament is not based on harmonics, even if some land quite close. The op asks why the spectrum he gets is not composed only of clean harmonics being multiple of the fundamental. As only one note is played temperament should not play a role.
– Tom
Mar 19 at 20:12
• Temperament is irrelevant because the data here concern the spectrum of a single pitch. The overtones of the A4 do not depend on the frequency to which the E5 is tuned, or the C♯5, or anything else. Mar 22 at 1:13
• No, but a single piano note actually consists of between 1 and 3 physical strings. On my piano (the upright), middle A consists of 3 strings. If they're detuned, how does that actually work out? Do they kind of average out, like out-of-synch metronomes which will eventually land on the same beat? or will they show up in the FT as a curve instead of a sharp spike, or does the beat get interpreted as a sub-harmonic, or what? I'm kind of getting excited about this question, because I know hopelessly little about how strings on a single note interact. Mar 22 at 1:19
• As you demonstrate, E note is just 2 cents off in the harmonic series of A; it's almost perfectly in tune. So playing A note will certainly excite a string tuned to E. The question is rather whether it explains what the OP observed. Mar 22 at 21:02