The Riemann zeta function and tuning: Difference between revisions

Mike Battaglia (talk | contribs)
Zeta EDO lists: some interesting ideas about integer edos... added a little bit and clarified some terminology
Xenwolf (talk | contribs)
m formatting
Line 1: Line 1:
__FORCETOC__
The Riemann zeta function is a famous mathematical function, best known for its relationship with the Riemann Hypothesis, a 200-year old unsolved problem involving the distribution of the prime numbers. However, it also has an incredible musical interpretation as measuring the "harmonicity" of an equal temperament. Put simply, the zeta function shows, in a certain sense, how well a given equal temperament approximates the harmonic series, and indeed *all* rational numbers, even up to "infinite-limit JI."
The Riemann zeta function is a famous mathematical function, best known for its relationship with the Riemann Hypothesis, a 200-year old unsolved problem involving the distribution of the prime numbers. However, it also has an incredible musical interpretation as measuring the "harmonicity" of an equal temperament. Put simply, the zeta function shows, in a certain sense, how well a given equal temperament approximates the harmonic series, and indeed *all* rational numbers, even up to "infinite-limit JI."


Line 6: Line 5:
Much of the below is thanks to the insights of [[Gene Ward Smith]]. Below is the original derivation as he presented it, followed by a different derivation from [[Mike Battaglia]] below which extends some of the results.
Much of the below is thanks to the insights of [[Gene Ward Smith]]. Below is the original derivation as he presented it, followed by a different derivation from [[Mike Battaglia]] below which extends some of the results.


=Gene Smith's Original Derivation=
= Gene Smith's Original Derivation =
==Preliminaries==
== Preliminaries ==
Suppose x is a variable representing some equal division of the octave. For example, if x = 80, x reflects 80edo with a step size of 15 cents and with pure octaves. Suppose that x can also be continuous, so that it can also represent fractional or "nonoctave" divisions as well. The [[Bohlen-Pierce|Bohlen-Pierce scale]], 13 equal divisions of 3/1, is approximately 8.202 equal divisions of the "octave" (although the octave itself does not appear in this tuning), and would hence be represented by a value of x = 8.202.
Suppose x is a variable representing some equal division of the octave. For example, if x = 80, x reflects 80edo with a step size of 15 cents and with pure octaves. Suppose that x can also be continuous, so that it can also represent fractional or "nonoctave" divisions as well. The [[Bohlen-Pierce|Bohlen-Pierce scale]], 13 equal divisions of 3/1, is approximately 8.202 equal divisions of the "octave" (although the octave itself does not appear in this tuning), and would hence be represented by a value of x = 8.202.


Line 48: Line 47:
so that we see that the absolute value of the zeta function serves to measure the relative error of an equal division.
so that we see that the absolute value of the zeta function serves to measure the relative error of an equal division.


==Into the critical strip==
== Into the critical strip ==
So long as s is greater than or equal to one, the absolute value of the zeta function can be seen as a relative error measurement. However, the rationale for that view of things departs when s is less than one, particularly in the [http://mathworld.wolfram.com/CriticalStrip.html critical strip], when s lies between zero and one. As s approaches the value s=1/2 of the [http://mathworld.wolfram.com/CriticalLine.html critical line], the information content, so to speak, of the zeta function concerning higher primes increases and it behaves increasingly like a badness measure (or more correctly, since we have inverted it, like a goodness measure.) The quasi-symmetric [http://planetmath.org/encyclopedia/FunctionalEquationOfTheRiemannZetaFunction.html functional equation] of the zeta function tells us that past the critical line the information content starts to decrease again, with 1-s and s having the same information content. Hence it is the zeta function between s=1/2 and s=1, and especially the zeta function along the critical line s=1/2, which is of the most interest.
So long as s is greater than or equal to one, the absolute value of the zeta function can be seen as a relative error measurement. However, the rationale for that view of things departs when s is less than one, particularly in the [http://mathworld.wolfram.com/CriticalStrip.html critical strip], when s lies between zero and one. As s approaches the value s=1/2 of the [http://mathworld.wolfram.com/CriticalLine.html critical line], the information content, so to speak, of the zeta function concerning higher primes increases and it behaves increasingly like a badness measure (or more correctly, since we have inverted it, like a goodness measure.) The quasi-symmetric [http://planetmath.org/encyclopedia/FunctionalEquationOfTheRiemannZetaFunction.html functional equation] of the zeta function tells us that past the critical line the information content starts to decrease again, with 1-s and s having the same information content. Hence it is the zeta function between s=1/2 and s=1, and especially the zeta function along the critical line s=1/2, which is of the most interest.


Line 55: Line 54:
Because the value of zeta increased continuously as it made its way from +∞ to the critical line, we might expect the values of zeta at these special Gram points to be relatively large. This would be especially true if -ζ'(z) is getting a boost from other small primes as it travels toward the Gram point. A complex formula due to [[Wikipedia:Bernhard Riemann|Bernhard Riemann]] which he failed to publish because it was so nasty becomes a bit simpler when used at a Gram point. It is named the [[Wikipedia:Riemann-Siegel formula|Riemann-Siegel formula]] since [[Wikipedia:Carl Ludwig Siegel|Carl Ludwig Siegel]] went looking for it and was able to reconstruct it after rooting industriously around in Riemann's unpublished papers. From this formula, it is apparent that when x corresponds to a good edo, the value of ζ(1/2 + i g) at the corresponding Gram point should be especially large.
Because the value of zeta increased continuously as it made its way from +∞ to the critical line, we might expect the values of zeta at these special Gram points to be relatively large. This would be especially true if -ζ'(z) is getting a boost from other small primes as it travels toward the Gram point. A complex formula due to [[Wikipedia:Bernhard Riemann|Bernhard Riemann]] which he failed to publish because it was so nasty becomes a bit simpler when used at a Gram point. It is named the [[Wikipedia:Riemann-Siegel formula|Riemann-Siegel formula]] since [[Wikipedia:Carl Ludwig Siegel|Carl Ludwig Siegel]] went looking for it and was able to reconstruct it after rooting industriously around in Riemann's unpublished papers. From this formula, it is apparent that when x corresponds to a good edo, the value of ζ(1/2 + i g) at the corresponding Gram point should be especially large.


==The Z function==
== The Z function ==
The absolute value ζ(1/2 + i g) at a Gram point corresponding to an edo is near to a local maximum, but not actually at one. At the local maximum, of course, the partial derivative of ζ(1/2 + i t) with respect to t will be zero; however this does not mean its derivative there will be zero. In fact, the [[Wikipedia:Riemann hypothesis|Riemann hypothesis]] is equivalent to the claim that all zeros of ζ'(s + i t) occur when s > 1/2, which is where all known zeros lie. These do not have values of t corresponding to good edos. For this and other reasons, it is helpful to have a function which is real for values on the critical line but whose absolute value is the same as that of zeta. This is provided by the [[Wikipedia:Z function|Z function]].
The absolute value ζ(1/2 + i g) at a Gram point corresponding to an edo is near to a local maximum, but not actually at one. At the local maximum, of course, the partial derivative of ζ(1/2 + i t) with respect to t will be zero; however this does not mean its derivative there will be zero. In fact, the [[Wikipedia:Riemann hypothesis|Riemann hypothesis]] is equivalent to the claim that all zeros of ζ'(s + i t) occur when s > 1/2, which is where all known zeros lie. These do not have values of t corresponding to good edos. For this and other reasons, it is helpful to have a function which is real for values on the critical line but whose absolute value is the same as that of zeta. This is provided by the [[Wikipedia:Z function|Z function]].


Line 94: Line 93:
Note that for one of its neighbors, 271, it isn't entirely clear which peak value corresponds to the line of real values from +∞. This can be determined by looking at the absolute value of zeta along other s values, such as s=1 or s=3/4, and in this case the local minimum at 271.069 is the value in question. However, other peak values are not without their interest; the local maximum at 270.941, for instance, is associated to a different mapping for 3.
Note that for one of its neighbors, 271, it isn't entirely clear which peak value corresponds to the line of real values from +∞. This can be determined by looking at the absolute value of zeta along other s values, such as s=1 or s=3/4, and in this case the local minimum at 271.069 is the value in question. However, other peak values are not without their interest; the local maximum at 270.941, for instance, is associated to a different mapping for 3.


==Zeta EDO lists==
== Zeta EDO lists ==
=== Peak EDOs ===
=== Peak EDOs ===
If we examine the increasingly larger peak values of |Z(x)|, we find they occur with values of x such that Z'(x) = 0 near to integers, so that there is a sequence of [[EDO|edo]]s
If we examine the increasingly larger peak values of |Z(x)|, we find they occur with values of x such that Z'(x) = 0 near to integers, so that there is a sequence of [[EDO|edo]]s
Line 110: Line 109:
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}}... . [[16808edo]] is also known to be strict zeta.
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}}... . [[16808edo]] is also known to be strict zeta.


==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. Here is a list of successively higher zeta peaks, taken to five decimal places:
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. Here is a list of successively higher zeta peaks, taken to five decimal places:


0.00000
<pre>
 
    0.00000
1.12657
    1.12657
 
    1.97277
1.97277
    3.05976
 
    3.90445
3.05976
    5.03448
 
    6.95669
3.90445
  10.00846
 
  12.02318
5.03448
  18.94809
 
  22.02515
6.95669
  27.08661
 
  30.97838
10.00846
  40.98808
 
  52.99683
12.02318
  71.95061
 
  99.04733
18.94809
  117.96951
 
  130.00391
22.02515
  152.05285
 
  170.99589
27.08661
  217.02470
 
  224.00255
30.97838
  270.01779
 
  341.97485
40.98808
  422.05570
 
  441.01827
52.99683
  494.01377
 
  742.01093
71.95061
  764.01938
 
  935.03297
99.04733
  953.94128
 
1012.02423
117.96951
1105.99972
 
1177.96567
130.00391
1236.02355
 
1394.98350
152.05285
1447.97300
 
1577.98315
170.99589
2459.98488
 
2683.99168
217.02470
3395.02659
 
5585.00172
224.00255
6079.01642
 
7032.96529
270.01779
8268.98378
 
8539.00834
341.97485
 
422.05570
 
441.01827
 
494.01377
 
742.01093
 
764.01938
 
935.03297
 
953.94128
 
1012.02423
 
1105.99972
 
1177.96567
 
1236.02355
 
1394.98350
 
1447.97300
 
1577.98315
 
2459.98488
 
2683.99168
 
3395.02659
 
5585.00172
 
6079.01642
 
7032.96529
 
8268.98378
 
8539.00834
 
11664.01488
11664.01488
14347.99444
14347.99444
16807.99325
16807.99325
28742.01019
28742.01019
34691.00191
34691.00191
</pre>


==Removing primes==
== Removing primes ==
The [http://mathworld.wolfram.com/EulerProduct.html Euler product] for the Riemann zeta function is
The [http://mathworld.wolfram.com/EulerProduct.html Euler product] for the Riemann zeta function is


Line 232: Line 182:
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==
== The 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]]


Line 245: Line 195:
The fact that x is slightly greater than 12 means 12 has an overall sharp quality. We may also find this out by looking at the value we computed for θ(2πr)/π, which was 31.927. Then 32 - 31.927 = 0.0726, which is positive but not too large; this is the second black magic formula, evaluating the nature of an edo x by computing floor(r ln(r) - r + 3/8) - r ln(r) + r + 1/8, where r = x/ln(2). This works more often than not on the clearcut cases, but when x is extreme it may not; 49 is very sharp in tendency, for example, but this method calls it as flat; similarly it counts 45 as sharp.
The fact that x is slightly greater than 12 means 12 has an overall sharp quality. We may also find this out by looking at the value we computed for θ(2πr)/π, which was 31.927. Then 32 - 31.927 = 0.0726, which is positive but not too large; this is the second black magic formula, evaluating the nature of an edo x by computing floor(r ln(r) - r + 3/8) - r ln(r) + r + 1/8, where r = x/ln(2). This works more often than not on the clearcut cases, but when x is extreme it may not; 49 is very sharp in tendency, for example, but this method calls it as flat; similarly it counts 45 as sharp.


==Computing zeta==
== Computing zeta ==
There are various approaches to the question of computing the zeta function, but perhaps the simplest is the use of the [[Wikipedia:Dirichlet eta function|Dirichlet eta function]] which was introduced to mathematics by [[Wikipedia:Johann Peter Gustav Lejeune Dirichlet|Johann Peter Gustav Lejeune Dirichlet]], who despite his name was a German and the brother-in-law of [[Wikipedia:Felix Mendelssohn|Felix Mendelssohn]].
There are various approaches to the question of computing the zeta function, but perhaps the simplest is the use of the [[Wikipedia:Dirichlet eta function|Dirichlet eta function]] which was introduced to mathematics by [[Wikipedia:Johann Peter Gustav Lejeune Dirichlet|Johann Peter Gustav Lejeune Dirichlet]], who despite his name was a German and the brother-in-law of [[Wikipedia:Felix Mendelssohn|Felix Mendelssohn]].


Line 255: Line 205:
The Dirichlet series for the zeta function is absolutely convergent when s&gt;1, justifying the rearrangement of terms leading to the alternating series for eta, which converges conditionally in the critical strip. The extra factor introduces zeros of the eta function at the points 1 + 2πix/ln(2) corresponding to pure octave divisions along the line s=1, but no other zeros, and in particular none in the critical strip and along the critical line. The convergence of the alternating series can be greatly accelerated by applying [[Wikipedia:Euler summation|Euler summation]].
The Dirichlet series for the zeta function is absolutely convergent when s&gt;1, justifying the rearrangement of terms leading to the alternating series for eta, which converges conditionally in the critical strip. The extra factor introduces zeros of the eta function at the points 1 + 2πix/ln(2) corresponding to pure octave divisions along the line s=1, but no other zeros, and in particular none in the critical strip and along the critical line. The convergence of the alternating series can be greatly accelerated by applying [[Wikipedia:Euler summation|Euler summation]].


=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 376: Line 326:
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 412: Line 362:
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 429: Line 379:
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 441: Line 391:
More can be found at the page on [[Harmonic_Entropy#Extending_HE_to_.5Bmath.5DN.3D.5Cinfty.5B.2Fmath.5D:_zeta-HE|Harmonic Entropy]], including a generalization to Renyi entropy for arbitrary <math>a</math>.
More can be found at the page on [[Harmonic_Entropy#Extending_HE_to_.5Bmath.5DN.3D.5Cinfty.5B.2Fmath.5D:_zeta-HE|Harmonic Entropy]], including a generalization to Renyi entropy for arbitrary <math>a</math>.


=Links=
= Links =
* [http://front.math.ucdavis.edu/0309.5433 X-Ray of Riemann zeta-function] by Juan Arias-de-Reyna
* [http://front.math.ucdavis.edu/0309.5433 X-Ray of Riemann zeta-function] by Juan Arias-de-Reyna
* [http://terrytao.wordpress.com/2009/07/12/selbergs-limit-theorem-for-the-riemann-zeta-function-on-the-critical-line/ Selberg's limit theorem] by Terence Tao [http://www.webcitation.org/5xrvgjW6T Permalink]
* [http://terrytao.wordpress.com/2009/07/12/selbergs-limit-theorem-for-the-riemann-zeta-function-on-the-critical-line/ Selberg's limit theorem] by Terence Tao [http://www.webcitation.org/5xrvgjW6T Permalink]