The Riemann zeta function and tuning: Difference between revisions

Inthar (talk | contribs)
Resized headers to comply with Wikipedia style guide, and added to new Category:Articles with proofs.
Inthar (talk | contribs)
m Standardized header capitalization.
Line 95: Line 95:
To generate this plot using the free version of Wolfram Cloud, you can copy-paste '''Plot[Abs[RiemannSiegelZ[9.06472028x]], {x, 11.9,12.1}]''' and then in the menu select '''Evaluation > Evaluate Cells'''. Change "'''11.9'''" and "'''12.1'''" to whatever values you want, e.g. to view the curve around 15edo you might use the values "'''14.9'''" and "'''15.1'''".
To generate this plot using the free version of Wolfram Cloud, you can copy-paste '''Plot[Abs[RiemannSiegelZ[9.06472028x]], {x, 11.9,12.1}]''' and then in the menu select '''Evaluation > Evaluate Cells'''. Change "'''11.9'''" and "'''12.1'''" to whatever values you want, e.g. to view the curve around 15edo you might use the values "'''14.9'''" and "'''15.1'''".


= Mike Battaglia's Expanded Results =
== Mike Battaglia's expanded results ==
=== Zeta Yields "Relative Error" Over All Rationals ===
=== Zeta yields "relative error" over all rationals ===


Above, Gene proves that the zeta function measures the [[Tenney-Euclidean_metrics|Tenney-Euclidean relative error]], sometimes called "Tenney-Euclidean Simple Badness," of any EDO, taken over all 'prime powers'. The relative error is simply equal to the tuning error times the size of the EDO, so we can easily get the raw "non-relative" tuning error from this as well by simply dividing by the size of the EDO.
Above, Gene proves that the zeta function measures the [[Tenney-Euclidean_metrics|Tenney-Euclidean relative error]], sometimes called "Tenney-Euclidean Simple Badness," of any EDO, taken over all 'prime powers'. The relative error is simply equal to the tuning error times the size of the EDO, so we can easily get the raw "non-relative" tuning error from this as well by simply dividing by the size of the EDO.
Line 179: Line 179:
Let's take a breather and see what we've got.
Let's take a breather and see what we've got.


=== Interpretation Of Results: "Cosine Relative Error" ===
=== Interpretation of results: "cosine relative error" ===


For every strictly positive rational n/d, there is a cosine with period 2π log<span style="font-size: 90%; vertical-align: sub;">2</span>(n/d). This cosine peaks at x=N/log<span style="font-size: 11.6999998092651px; vertical-align: sub;">2</span>(n/d) for all integer N, or in other words, the Nth-equal division of the rational number n/d, and hits troughs midway between.
For every strictly positive rational n/d, there is a cosine with period 2π log<span style="font-size: 90%; vertical-align: sub;">2</span>(n/d). This cosine peaks at x=N/log<span style="font-size: 11.6999998092651px; vertical-align: sub;">2</span>(n/d) for all integer N, or in other words, the Nth-equal division of the rational number n/d, and hits troughs midway between.
Line 216: Line 216:
Now, one nitpick to notice above is that this expression technically involves all 'unreduced' rationals, e.g. there will be a cosine error term not just for 3/2, but also for 6/4, 9/6, etc. However, we can easily show that the same expression also measures the cosine relative error for reduced rationals:
Now, one nitpick to notice above is that this expression technically involves all 'unreduced' rationals, e.g. there will be a cosine error term not just for 3/2, but also for 6/4, 9/6, etc. However, we can easily show that the same expression also measures the cosine relative error for reduced rationals:


=== From Unreduced Rationals to Reduced Rationals ===
=== From unreduced rationals to reduced rationals ===
Let's go back to this expression here:
Let's go back to this expression here:


Line 252: Line 252:
Now, since we're fixing σ and letting t vary, the left zeta term is constant for all EDOs. This demonstrates that the zeta function also measures cosine error over all the reduced rationals, up to a constant factor. QED.
Now, since we're fixing σ and letting t vary, the left zeta term is constant for all EDOs. This demonstrates that the zeta function also measures cosine error over all the reduced rationals, up to a constant factor. QED.


=== Measuring Error on Harmonics Only ===
=== Measuring error on harmonics only ===
So far we have shown the following:
So far we have shown the following:


Line 269: Line 269:
Note that, although the last four expressions were all monotonic transformations of one another, this one is not - this is the 'real part' of the zeta function, whereas the others were all some simple monotonic function of the 'absolute value' of the zeta function. The results, however, are  very similar - in particular, the peaks are approximately to one another, shifted by only a small amount (at least for reasonably-sized EDOs up to a few hundred).
Note that, although the last four expressions were all monotonic transformations of one another, this one is not - this is the 'real part' of the zeta function, whereas the others were all some simple monotonic function of the 'absolute value' of the zeta function. The results, however, are  very similar - in particular, the peaks are approximately to one another, shifted by only a small amount (at least for reasonably-sized EDOs up to a few hundred).


=== Relationship to Harmonic Entropy ===
=== Relationship to harmonic entropy ===


The expression
The expression
Line 288: Line 288:
Alternatively (as [[User:Ks26|groundfault]] has found), if we allow no octave stretching and thus only look at the record |Z(x)| zeta scores corresponding to exact EDOs with pure octaves, we get {{EDOs|1, 2, 3, 5, 7, 10, 12, 19, 22, 31, 41, 53, 87, 118, 130, 171, 224, 270, 311, 472, 494, 742, 1065, 1106, 1395, 1578, 2460, 2684, 3566, 4231, 4973, 5585, 8269, 8539, 14124, 14348, 16808, 28742, 30631, 34691, 36269, 57578, 58973}} ... of ''zeta peak integer EDOs''. EDOs in this list not included in the previous are {{EDOs|87, 311, 472, 1065, 3566, 4231, 4973, 14124, 30631,}} ... and EDOs not included in this list but included in the previous are {{EDOs|4, 27, 72, 99, 152, 217, 342, 422, 441, 764, 935, 954, 1012, 1178, 1236, 1448, 3395, 6079, 7033, 11664,}} ... with 72's removal perhaps being the most surprising, showing the strength of 53 in that 72 does not improve on the peak of 53. This definition may be better for measuring how accurate the edo itself is without stretched octaves, whereas the previous list assumes that the octave is tempered along with all other intervals. This list can thus also be thought of as "pure-octave zeta peak EDOs." Similarly, we can look at pure-tritave EDTs, etc.
Alternatively (as [[User:Ks26|groundfault]] has found), if we allow no octave stretching and thus only look at the record |Z(x)| zeta scores corresponding to exact EDOs with pure octaves, we get {{EDOs|1, 2, 3, 5, 7, 10, 12, 19, 22, 31, 41, 53, 87, 118, 130, 171, 224, 270, 311, 472, 494, 742, 1065, 1106, 1395, 1578, 2460, 2684, 3566, 4231, 4973, 5585, 8269, 8539, 14124, 14348, 16808, 28742, 30631, 34691, 36269, 57578, 58973}} ... of ''zeta peak integer EDOs''. EDOs in this list not included in the previous are {{EDOs|87, 311, 472, 1065, 3566, 4231, 4973, 14124, 30631,}} ... and EDOs not included in this list but included in the previous are {{EDOs|4, 27, 72, 99, 152, 217, 342, 422, 441, 764, 935, 954, 1012, 1178, 1236, 1448, 3395, 6079, 7033, 11664,}} ... with 72's removal perhaps being the most surprising, showing the strength of 53 in that 72 does not improve on the peak of 53. This definition may be better for measuring how accurate the edo itself is without stretched octaves, whereas the previous list assumes that the octave is tempered along with all other intervals. This list can thus also be thought of as "pure-octave zeta peak EDOs." Similarly, we can look at pure-tritave EDTs, etc.


=== Integral of Zeta EDOs ===
=== Integral of zeta EDOs ===
Similarly, if we take the integral of |Z(x)| between successive zeros, and use this to define a sequence of increasing values for this integral, these again occur near integers and define an edo. This sequence, the ''zeta integral edos'', goes {{EDOs|2, 5, 7, 12, 19, 31, 41, 53, 72, 130, 171, 224, 270, 764, 954, 1178, 1395, 1578, 2684, 3395, 7033, 8269, 8539, 14348, 16808, 36269, 58973,}} ... This is listed in the OEIS as {{OEIS|A117538}}. The zeta integral edos seem to be, on the whole, the best of the zeta function sequences, but the other two should not be discounted; the peak values seem to give more weight to the lower primes, and the zeta gap sequence discussed below to the higher primes.
Similarly, if we take the integral of |Z(x)| between successive zeros, and use this to define a sequence of increasing values for this integral, these again occur near integers and define an edo. This sequence, the ''zeta integral edos'', goes {{EDOs|2, 5, 7, 12, 19, 31, 41, 53, 72, 130, 171, 224, 270, 764, 954, 1178, 1395, 1578, 2684, 3395, 7033, 8269, 8539, 14348, 16808, 36269, 58973,}} ... This is listed in the OEIS as {{OEIS|A117538}}. The zeta integral edos seem to be, on the whole, the best of the zeta function sequences, but the other two should not be discounted; the peak values seem to give more weight to the lower primes, and the zeta gap sequence discussed below to the higher primes.


=== Zeta Gap EDOs ===
=== Zeta gap EDOs ===
Finally, taking the midpoints of the successively larger normalized gaps between the zeros of Z leads to a list of ''zeta gap edos''. These are {{EDOs|2, 3, 5, 7, 12, 19, 31, 46, 53, 72, 270, 311, 954, 1178, 1308, 1395, 1578, 3395, 4190, 8539, 14348, 58973, 95524,}} ... Since the density of the zeros increases logarithmically, the normalization is to divide through by the log of the midpoint. These edos are listed in the OEIS as {{OEIS|A117537}}. The zeta gap edos seem to weight higher primes more heavily and have the advantage of being easy to compute from a table of zeros on the critical line.
Finally, taking the midpoints of the successively larger normalized gaps between the zeros of Z leads to a list of ''zeta gap edos''. These are {{EDOs|2, 3, 5, 7, 12, 19, 31, 46, 53, 72, 270, 311, 954, 1178, 1308, 1395, 1578, 3395, 4190, 8539, 14348, 58973, 95524,}} ... Since the density of the zeros increases logarithmically, the normalization is to divide through by the log of the midpoint. These edos are listed in the OEIS as {{OEIS|A117537}}. The zeta gap edos seem to weight higher primes more heavily and have the advantage of being easy to compute from a table of zeros on the critical line.


=== Strict Zeta EDOs ===
=== Strict zeta EDOs ===
We may define the ''strict zeta edos'' to be the edos that are in all four of the zeta edo lists. The list of strict zeta edos begins {{EDOs|2, 5, 7, 12, 19, 31, 53, 270, 1395, 1578, 8539, 14348, 58973}}... .
We may define the ''strict zeta edos'' to be the edos that are in all four of the zeta edo lists. The list of strict zeta edos begins {{EDOs|2, 5, 7, 12, 19, 31, 53, 270, 1395, 1578, 8539, 14348, 58973}}... .


= Optimal Octave Stretch =
== Optimal octave stretch ==
Another use for the Riemann zeta function is to determine the optimal tuning for an EDO, meaning the optimal octave stretch. This is because the zeta peaks are typically not integers. The fractional part can give us the degree to which the generator diverges from what you would need to have the octave be a perfect 1200 cents.  
Another use for the Riemann zeta function is to determine the optimal tuning for an EDO, meaning the optimal octave stretch. This is because the zeta peaks are typically not integers. The fractional part can give us the degree to which the generator diverges from what you would need to have the octave be a perfect 1200 cents.  


Line 383: Line 383:
Removing 2 leads to increasing adjusted peak values corresponding to the division of 3 (the "tritave") into 4, 7, 9, 13, 15, 17, 26, 32, 39, 45, 52, 56, 71, 75, 88, 131, 245, 316 ... parts. A striking feature of this list is the appearance not only of [[13edt|13edt]], the [[Bohlen-Pierce|Bohlen-Pierce]] division of the tritave, but the multiples 26, 39 and 52 also.
Removing 2 leads to increasing adjusted peak values corresponding to the division of 3 (the "tritave") into 4, 7, 9, 13, 15, 17, 26, 32, 39, 45, 52, 56, 71, 75, 88, 131, 245, 316 ... parts. A striking feature of this list is the appearance not only of [[13edt|13edt]], the [[Bohlen-Pierce|Bohlen-Pierce]] division of the tritave, but the multiples 26, 39 and 52 also.


=== The Black Magic Formulas ===
=== Black magic formulas ===
When [[Gene_Ward_Smith|Gene Smith]] discovered these formulas in the 70s, he thought of them as "black magic" formulas not because of any aura of evil, but because they seemed mysteriously to give you something for next to nothing. They are based on Gram points and the Riemann-Siegel theta function θ(t). Recall that a Gram point is a point on the critical line where ζ(1/2 + ig) is real. This implies that exp(iθ(g)) is real, so that θ(g)/π is an integer. Theta has an [[Wikipedia:asymptotic expansion|asymptotic expansion]]
When [[Gene_Ward_Smith|Gene Smith]] discovered these formulas in the 70s, he thought of them as "black magic" formulas not because of any aura of evil, but because they seemed mysteriously to give you something for next to nothing. They are based on Gram points and the Riemann-Siegel theta function θ(t). Recall that a Gram point is a point on the critical line where ζ(1/2 + ig) is real. This implies that exp(iθ(g)) is real, so that θ(g)/π is an integer. Theta has an [[Wikipedia:asymptotic expansion|asymptotic expansion]]