User:Overthink/The circle of relative error

From Xenharmonic Wiki
Revision as of 21:36, 28 September 2025 by Overthink (talk | contribs) (The circle of relative error: added more theory)
Jump to navigation Jump to search
12edo 3: +2.0% 5: +13.7% 7: +31.2% 9: +3.9% 11: +48.7% 13: -40.5% 15: +11.7%
Relative error of harmonics in 12edo

In an equal temperament, relative error is the amount by which the mapping of an interval or harmonic deviates from its just value. For example, in 12edo the relative error of 3/2 is -2.0%, and the relative error of 5/4 is +13.7%. We can plot the relative error of harmonics in a graph like the one on the right. This graph lets us calculate the relative error of intervals. For example, the relative error of 6/5 is 13.7%-(-2.0%)=15.6% (not 15.7% due to rounding error). Note that absolute error can be found by multiplying the relative error by the equal division's step size, and in 12edo absolute and relative error are identical. However, one may not always want to use the nearest approximation of every harmonic. For example, in 12edo, using the second best approximation for harmonic 13 (relative error +59.5%) actually gives us less error overall due to cancellation of errors between harmonics. As an example, the relative error of 13/11 in this mapping is 59.5%-48.7%=10.8%. Compare this to the patent val, where all primes use their nearest mappings, where 13/11 has an error of -40.5%-48.7%=-89.2%. If a prime is near perfectly off, the sharp and flat mappings are each the best about equally often, depending on the errors of the other harmonics. Therefore, it is natural to plot relative error not on a range from -50% to +50%, but on a circle.

The circle of relative error

Relative error on a circle, Clockwise: sharp. Counterclockwise: flat.
The circle of relative error of 12edo

We plot relative error on a circle as follows: The top corresponds to zero error, far left is 25% flat, far right is 25% sharp, and the bottom is ±50% error. For each harmonic, the point corresponding to that harmonic on the circle has its angle corresponding to its relative error; the top corresponds to no error, sharper is clockwise, and flatter is counterclockwise. Note that harmonic 1 (the unison) is always on the top. The plot for 12edo, with odd harmonics up to 15, is on the right. Put simply, the relative error of a ratio between two harmonics is the distance, or length of the arc, between those harmonics on the circle. That naive definition doesn't work all the time, however. The point of the circle is that we don't always use the best mapping of each harmonic, so we must choose a point (call it the sharp-flat cutoff, or SFC) where any harmonic flatter than it uses the sharp mapping instead, and any harmonic sharper than it uses the flat mapping instead. We often choose the SFC to be at 50%, where every harmonic uses its closest mapping. Since harmonics on opposite sides of the SFC (e.g. 11 and 13 in 12edo) are mapped in opposite directions in terms of sharpness or flatness, we cannot consider the error of ratios between them off the shortest distance (minor arc) between them, but the longer distance (major arc) instead. As a more precise definition, the error of a ratio between two harmonics is the length of the arc between the points corresponding to those harmonics that doesn't cross the sharp-flat cutoff, with a full circle being 100%.


An interval is consistent if its relative error is less than 50%. This corresponds to the arc between the corresponding harmonics being less than 180 degrees, or a semicircle. An equal division of the octave is consistent in the q-odd-limit if and only if all of the arcs between two odd harmonics up to q (that don't cross the SFC) are less than 180 degrees. Note that for an EDO to be fully consistent, this property must hold with the SFC at exactly 50%. The longest arc between two harmonics is the one between the harmonic closest to the SFC counterclockwise of it and the closest harmonic clockwise of it. For example, in 12edo with the SFC at 50%, the closest harmonic clockwise of the SFC is 13 at -40.5%, and the closest counterclockwise of it is 11 at +48.7%, with the distance between them being 89.2%. However, the SFC does not have to be at 50%; what if we set it at -40% (which is equivalent to +60%) instead? Then, harmonic 13 would be counterclockwise of the SFC and therefore be mapped sharply with +59.5% relative error. Though harmonic 13 itself has greater error, this reduces the error of many intervals. For example, 13/11 now has a relative error of 59.5%-48.7%=10.8%. The maximum relative error of any interval in the 15-odd-limit is now 59.5%-(-3.9%)=63.4% instead; not consistent, but much better than the 89.2% we had before.


Up until now, we have assumed that mappings of composite harmonics are equal to the sum of the mappings of the primes they factor into. For example, the composite number 9 factors into primes as 3*3, and in 12edo, the mapping of harmonic 3 is 19 steps, so the mapping of harmonic 9 is 19+19=38 steps. Since the error of harmonic 3 in 12edo is low (-1.96%), this works out nicely. But what if we are using a system where this doesn't work out so nicely, such as 35edo?