Mu badness

From Xenharmonic Wiki
Jump to navigation Jump to search

[math]\displaystyle{ \def\hs{\hspace{-3px}} \def\vsp{{}\mkern-5.5mu}{} \def\llangle{\left\langle\vsp\left\langle} \def\lllangle{\left\langle\vsp\left\langle\vsp\left\langle} \def\llllangle{\left\langle\vsp\left\langle\vsp\left\langle\vsp\left\langle} \def\llbrack{\left[\left[} \def\lllbrack{\left[\left[\left[} \def\llllbrack{\left[\left[\left[\left[} \def\llvert{\left\vert\left\vert} \def\lllvert{\left\vert\left\vert\left\vert} \def\llllvert{\left\vert\left\vert\left\vert\left\vert} \def\rrangle{\right\rangle\vsp\right\rangle} \def\rrrangle{\right\rangle\vsp\right\rangle\vsp\right\rangle} \def\rrrrangle{\right\rangle\vsp\right\rangle\vsp\right\rangle\vsp\right\rangle} \def\rrbrack{\right]\right]} \def\rrrbrack{\right]\right]\right]} \def\rrrrbrack{\right]\right]\right]\right]} \def\rrvert{\right\vert\right\vert} \def\rrrvert{\right\vert\right\vert\right\vert} \def\rrrrvert{\right\vert\right\vert\right\vert\right\vert} }[/math][math]\displaystyle{ \def\abs#1{\left|{#1}\right|} \def\norm#1{\left\|{#1}\right\|} \def\floor#1{\left\lfloor{#1}\right\rfloor} \def\ceil#1{\left\lceil{#1}\right\rceil} \def\round#1{\left\lceil{#1}\right\rfloor} \def\rround#1{\left\lfloor{#1}\right\rceil} }[/math] Mu badness is a badness for equal tunings provided by VectorGraphics, and in a slightly different form by Lériendil.

For a given EDO x, it is defined as:

$$ \mu \left( x \right) = \sum_{k=1}^{\infty}f \left( x, k \right) $$

where

$$ f \left( x, k \right) = \frac{\abs{\operatorname{mod} \left( 2g \left( k \right) x, 2 \right) - 1}}{k^{2}} $$

and

$$ g \left( k \right) = \log_{2} \left( k \right) $$.

The function essentially sums up the relative error on all integer harmonics k, weighted by the inverse square 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:

$$ \abs{\operatorname{mod} \left( 2x, 2 \right) - 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 \left( k \right) = \log_{2} \left( k \right) $$

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

$$ \abs{\operatorname{mod} \left( 2g \left( k \right) x, 2 \right) - 1} $$

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

μ always provides a value between 1 and ζ(2) = π2/6 ≈ 1.6449, as such, the final "mu badness" result can be obtained by

$$ \mu_{s} \left( x \right) = \frac{\left( \frac{\pi^{2}}{6} \right) - \mu \left( x \right)}{\left( \frac{\pi^{2}}{6} \right) - 1} $$

Lériendil prefers to set the denominator to π220 instead, as it can be shown that this represents a stricter bound on μ and has the advantage of the maximal possible badness for an EDO being a rational number, 5/9. This also flips the result so that higher values represent worse tunings, as would be expected from a "badness" function.

Mu badness.png

Mu badness for equal-step tunings between 1EDO and 121EDO using π220 scaling convention. The blue and orange dotted lines represent the best possible odd ED4 and the worst possible EDO, respectively.

Peaks and valleys

Below is a table of mu badness (μs(x)) for EDOs, calculated up to k = 100.

EDO Badness
5 0.182
7 0.184
12 0.126
13 0.311
15 0.227
16 0.278
17 0.191
19 0.175
22 0.163
23 0.369
24 0.147
25 0.278
26 0.239
27 0.253
29 0.177
31 0.139
34 0.170
41 0.108
53 0.086

One can also define mu peaks, similar to zeta peaks. The mu peak integer EDOs (ignoring zero) calculated up to k = 100 include 1, 2, 3, 5, 12, 41, 53, 441, 494, 612, 2460, 3125, 6079, …. Note that this may differ slightly from the true list, only the first 100 terms of μ are calculated.

The mu peaks proper (at the same fidelity) include 1, 2, 3, 5, 12, 41, 53 (52.99916), 171 (170.98894), 441 (441,0088), 494, 612, 2460, 3125...

The mu valley EDOs calculated up to k = 100 include 1, 8, 11, 18, 23, 76, 194, 247, ….

The "Parker mu peak integers" are 4, 7, 19, 22, 24, 31, 65, 94, 118, 171, 665, ….

It is of note that, compared to zeta, this badness metric strongly favors low prime limits.

Weighted mu

In order to more or less strongly favor lower primes, one can generalize the weighting factor 1k2 to 1kσ, where σ is a number greater than 1. Note that this requires many more iterations to reasonably converge on a value the closer σ is to 1.

Alternative relative error function

If the cosine function is used as the relative error function as opposed to the zigzag, the result is the real part of the zeta function at s = σ + ix.