Equal tuning accuracy functions: Difference between revisions

From Xenharmonic Reference
No edit summary
No edit summary
Line 43: Line 43:
[https://www.desmos.com/calculator/deafikrhvg] <math> \sum_{k=1}^{\infty}\frac{\cos\left(\log_{2}\left(k\right)\tau x\right)}{k^{\sigma}} </math>
[https://www.desmos.com/calculator/deafikrhvg] <math> \sum_{k=1}^{\infty}\frac{\cos\left(\log_{2}\left(k\right)\tau x\right)}{k^{\sigma}} </math>


Let's clean up the function by removing the scale factors on ''x''. This just scales the function's inputs from EDO to the equal divisions of a different interval, and these can be added back later to go back to EDO.
Let's clean up the function by removing the scale factors on ''x''. This just scales the function's inputs from EDO to the equal divisions of a different interval (e<sup>τ</sup>/1), and these can be added back later to go back to EDO.


[https://www.desmos.com/calculator/26ypbwbglg] <math> \sum_{k=1}^{\infty}\frac{\cos (\ln\left(k\right)x)}{k^{\sigma}} </math>
[https://www.desmos.com/calculator/26ypbwbglg] <math> \sum_{k=1}^{\infty}\frac{\cos (\ln\left(k\right)x)}{k^{\sigma}} </math>

Revision as of 20:28, 18 May 2026

This is a technical or mathematical page. While the subject may be of some relevance to music, the page treats the subject in technical language.

There are a number of ways to quantify the tuning accuracy of equal temperaments.

Mu function

The mu function is defined as:

μ(x,σ)=k=1f(x,k,σ)

for a given edo x and weight σ (greater than 1), where

f(x,k,σ)=|mod(2g(k)x,2)1|kσ

and

g(k)=log2(k)

.

The function essentially sums up the relative error on all integer harmonics k, weighted by the inverse power to sigma of k in order to converge to a finite value.

It is derived as follows.

For each integer harmonic k, the relative error on that integer in the continuum of equal tunings follows a zigzag line where 1 is an equal division of k, and 0 is an odd equal division of 2k (which has the largest possible error on k). Such a zigzag line takes the form of:

|mod(2x,2)1|

for k = 2, if integer values of x are EDOs.

Equal divisions of any integer k can be found by multiplying 2x by

g(k)=log2(k)

As such, finding our final function is simply a matter of summing up

|mod(2g(k)x,2)1|

for all integers k. To make the sum finite at all values, we weight each term by 1/kσ, producing our final formula for f, and thus for μ.

Zeta function

There is a derivation of the Riemann zeta function as a variant of the previously established mu function, which is occasionally used to determine optimal octave stretches for edos, and which allows the analytic continuation of the function to allow values of sigma less than 1.

[1] k=1cos(log2(k)τx)kσ

Let's clean up the function by removing the scale factors on x. This just scales the function's inputs from EDO to the equal divisions of a different interval (eτ/1), and these can be added back later to go back to EDO.

[2] k=1cos(ln(k)x)kσ

By the complex exponential theorem, which relates trigonometric functions and the exponential function, we know that

eix=cos(x)+isin(x)

where i is the square root of −1, and e is the natural exponential constant.

i is the imaginary unit, which is on a line perpendicular to the real number line. A complex (two-dimensional) number may be written as a + bi.

With this knowledge, cos(x) can be rewritten as Re(eix)—but since we're only doing multiplication and addition and this is the only place complex numbers appear, we can just ignore the Re() and add it back later.

[3] μc(σ,x)=k=1ei(ln(k)x)kσ

Since eln(n)x = nx, the exponentials and logarithms cancel each other out (i.e. eln(n) = n), so:

[4] k=1kixkσ

[5] k=1kixkσ

[6] k=1kσ+ix

−σ + ix is just a complex number, which we may write as −s:

μd(s)=k=1ks

where, for s = σ − ix, Re(μd(s)) = μc(σ, x), our badness function.

μd is a mathematical function called the Riemann zeta function, so μd(s) = ζ(s), and re-adding the Re() function gives Re(ζ(s)) with s = σ − ix; x is the equal division and σ is the weight.