Harmonic errors in acoustic instruments

If a note has a fundamental frequency of 100Hz, then its second harmonic is located at 200Hz and its tenth harmonic is located at 1000Hz. But for acoustic instruments, the harmonics will not occur at exact multiples of the fundamental. My question is, how much error is typical and what is the relationship between the degree of error and the harmonic number. So for example, is it common for the error in the tenth harmonic to be as much as, say, 50Hz. 1050Hz in other words. That's a 5% error. But would a 5% error be just as likely for the second harmonic?

• "Acoustic" isn't the right qualifier. Bowed string instruments and reed instruments are harmonic, while plucked electric guitars are inharmonic. – endolith Nov 29 '12 at 15:56

how much error is typical and what is the relationship between the degree of error and the harmonic number

I think that's hard to answer. Do you want to include contrived weird instruments with terrible inharmonicity? Inherently inharmonic instruments that are manipulated to sound roughly harmonic, like bells and tympani?

I started writing a program to analyze all of the Musical Instrument Samples Database and measure the inharmonicity of each harmonic, which would answer your question exactly for all those instruments, but I didn't finish it yet. :) Here's a preliminary test graph, to give you a rough idea:

X axis is harmonic number, Y axis is frequency relative to a perfect multiple. If the fundamental is 100 Hz, for instance, and the 2nd harmonic is 210 Hz, it will be mapped to 210/200 = 1.05. The blue and green are piano tones (I didn't write down the fundamental frequency I used for this graph). Purple and yellow are guitar. Struck or plucked strings are inharmonic, with higher partials sharper than true harmonics. The red and teal are double bass. Bowed strings are perfectly harmonic because of the slip-stick motion of the bow. (Though there are weird jumps at the 2nd or 3rd harmonic. Not sure what those are from.)

The flattening out at the top right is definitely wrong, due to the algorithm "locking onto" things that are not actually harmonics.

So for piano, you have to go up to the 25th partial to get 5% out of tune. The 2nd partial is less than 1% off. At the extremes, the 50th partial is maybe 13% sharp from the pure 50th harmonic.

A few things:

• Not all instruments have partials neatly defined by the $h_n = nf$. Kettle drums would be an obvious example, but bells are another. In this case, you will be way off looking in the "usual places" +/- 5%.
• Many instruments have only even or odd harmonics. Others are designed to omit some harmonics. The piano, for example, is designed to have almost no 7th harmonic. This may not matter to you, but it's worth pointing out in case it does.
• It is common for higher harmonics to be "out of tune", that is, not in the "usual places". An engineer who once worked as a piano tuner once admonished me for using harmonics to tune my upright bass (a technique that works well for lighter-stringed instruments), because, he said, the partials are more out of tune with heavier stringed instruments. He said it's especially true told of higher harmonics, explaining that the math that gives you the simple formula for partials assumes that strings have no mass. 5% strikes me as a little much (almost a semi-tone!), but I don't think it's out of the question.
• Many instruments have vibrato. This throws all your harmonics out of wack:

• Why are pianos designed to have no 7th harmonic? – Jim Clay Nov 30 '12 at 13:39
• The 7th harmonic is the first harmonic which is extremely "out of tune" compared to the equal-tempered scale. – Bjorn Roche Nov 30 '12 at 19:38
• "piano tuner once admonished me for using harmonics to tune my upright bass" That seems backwards. You want to tune the harmonics to each other because they're out of tune, and that's the tone we hear. en.wikipedia.org/wiki/Stretched_tuning "When octaves are stretched, they are tuned, not to the lowest coincidental overtone (second partial) of the note below, but to a higher one (often the 4th partial). This widens all intervals equally, thereby maintaining intervallic and tonal consistency." en.wikipedia.org/wiki/Piano_tuning#Stretched_octaves – endolith Dec 1 '12 at 2:13
• endolith, I think you misunderstood. His point was that partials, especially on string instruments with heavy strings, are not where they should be, so they are not an appropriate tuning reference. Also, stretched tuning is not usually used on guitars and basses. – Bjorn Roche Dec 1 '12 at 16:11
• From "Modern College Physics," H. E White, D. Van Nostrand, 1956, p. 369 regarding piano harmonics: "If middle C = 264 is sounded, they will have 2, 3, 4, 5, 6, 7 and 8 times 264 vib./sec. (...) All these except (the seventh) belong to some harmonic triad. This very overtone is discordant and should be suppressed. In a piano this is accomplished by striking the string one-seventh of its length from the end, thus preventing a node at that point." The author also mentions that a piano is tuned to an equal tempered scale, and that some musicians (particularly violinists), play to pure intonation – Kevin McGee Dec 8 '12 at 5:13

The idea that the higher harmonics are exact multiple of the fundamental is only true for a model that is a) pure linear, b) continuous , and c) only one-dimensional. Nothing of that is true in reality. The exact reason why it is for the piano exactly the way it is I cannot answer. But the main reason is nonlinearity in combination with the fact that even a string must be treated three-dimensional if one is interested in the details.