Harmonic entropy: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m update shortcut to something easier to type
 
(17 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Legacy}}
'''Harmonic entropy''' ('''HE''') is a simple model to quantify the extent to which musical [[chord]]s align with the [[harmonic series]], and thus tend to partly "fuse" into the perception of a single sound with a complex timbre and [[virtual fundamental]] pitch.  
'''Harmonic entropy''' ('''HE''') is a simple model to quantify the extent to which musical chords align with the harmonic series, and thus tend to partly "fuse" into the perception of a single sound with a complex timbre and '''virtual fundamental''' pitch. It was invented by Paul Erlich and developed extensively on the Yahoo! tuning and harmonic_entropy lists, and draws from prior research by Parncutt and Terhardt. Various later contributions to the model have been made by Steve Martin, Mike Battaglia, Keenan Pepper, and others.


Note: the terms dyad, triad and tetrad usually refer to chord with 2, 3 or 4 [[Pitch class|pitch classes]]. But in this discussion they refer to chords with 2, 3, or 4 <u>pitches</u>. Thus {{dash|C, E, G, C}} is a tetrad instead of a triad.
A simple way to state this, is: harmonic entropy measures degree of certainty in the perception of the (virtual) [[root]].
 
Harmonic entropy was invented by [[Paul Erlich]] and developed extensively on the Yahoo! tuning and harmonic_entropy lists, and draws from prior research by Parncutt and Terhardt. Various later contributions to the model have been made by [[Steve Martin]], [[Mike Battaglia]], [[Keenan Pepper]], and others.
 
An interactive harmonic entropy graph can be found in [[Scale Workshop]] version 3 in the Analysis tab.
 
Note: the terms dyad, triad and tetrad usually refer to chord with 2, 3, or 4 [[pitch class]]es. But in this discussion they refer to chords with 2, 3, or 4 ''pitches''. Thus {{dash|C, E, G, C}} is a tetrad instead of a triad.


== Background ==
== Background ==
Line 14: Line 19:
There has been much research specifically on the musical implications critical band effects in the literature (e.g. Sethares's work), which are perhaps the psychoacoustic phenomena that readers are most familiar with. However, the modern xenharmonic community has displayed immense interest in exploring the other effects mentioned above as well, which have proven extremely important to the development of modern xenharmonic music.
There has been much research specifically on the musical implications critical band effects in the literature (e.g. Sethares's work), which are perhaps the psychoacoustic phenomena that readers are most familiar with. However, the modern xenharmonic community has displayed immense interest in exploring the other effects mentioned above as well, which have proven extremely important to the development of modern xenharmonic music.


These effects sometimes behave differently, and do not always appear strictly in tandem with one another. For instance, Paul Erlich has noted that most models for beatlessness measure 10:12:15 and 4:5:6 as being identical, whereas the latter exhibits more timbral fusion and a more salient virtual fundamental than the former. However, it is useful to have a term that refers to the general presence of these types of effects. The term "consonance" has sometimes been used for this; however, there are many other meanings of consonance which may not be psychoacoustic in nature. Thus, we instead speak of a general notion of psychoacoustic '''concordance''' - the degree to which effects such as the above will appear when an arbitrary musical interval or chord is played - as well and psychoacoustic '''discordance'''. Timbral fusion, the appearance of virtual fundamentals, beatlessness, and periodicity buzz, can all be thought of as different aspects of psychoacoustic concordance.
These effects sometimes behave differently, and do not always appear strictly in tandem with one another. For instance, Paul Erlich has noted that most models for beatlessness measure 10:12:15 and 4:5:6 as being identical, whereas the latter exhibits more timbral fusion and a more salient virtual fundamental than the former. However, it is useful to have a term that refers to the general presence of these types of effects. The term "consonance" has sometimes been used for this; however, there are many other meanings of consonance which may not be psychoacoustic in nature. Thus, we instead speak of a general notion of psychoacoustic '''concordance''' the degree to which effects such as the above will appear when an arbitrary musical interval or chord is played as well and psychoacoustic '''discordance'''. Timbral fusion, the appearance of virtual fundamentals, beatlessness, and periodicity buzz, can all be thought of as different aspects of psychoacoustic concordance.


Harmonic Entropy was originally intended to measure, in particular, the "virtual fundamental" aspect of psychoacoustic concordance, being modeled on J. Goldstein's [https://asa.scitation.org/doi/10.1121/1.1914448 1973 paper] "An optimum processor theory for the central formation of the pitch of complex tones." It can also be thought of as an elaboration on similar research by Terhardt, Parncutt and others, which addresses some of the shortcomings suggested by Erlich in prior models. The model basically asks how "confused your brain is," in Erlich's words, when trying to match the incoming sound to that of one single harmonic timbre played on a missing fundamental.
Harmonic entropy was originally intended to measure, in particular, the "virtual fundamental" aspect of psychoacoustic concordance, being modeled on J. Goldstein's [https://asa.scitation.org/doi/10.1121/1.1914448 1973 paper] "An optimum processor theory for the central formation of the pitch of complex tones." It can also be thought of as an elaboration on similar research by Terhardt, Parncutt and others, which addresses some of the shortcomings suggested by Erlich in prior models. The model basically asks how "confused your brain is," in Erlich's words, when trying to match the incoming sound to that of one single harmonic timbre played on a missing fundamental.


For dyads, the basic harmonic entropy model is fairly simple: it places the dyad we are trying to measure amidst a backdrop of JI candidates. Then, it uses a point-spread function to determine the relative strengths of the match to each, which are then normalized and treated as probabilities. The "entropy" of the resulting probability distribution is a way to measure how closely this distribution tends to focus on one possibility, rather than being spread out among a set of equally-likely possibilities. If there is only one clear choice of dyad which far exceeds all others in probability, the entropy will be lower. If, on the other hand, there are many equally-likely probabilities, the entropy will be higher. The basic harmonic entropy model can also be extended to modeling triads, tetrads, and so on; the standard way to do so is to simply look at the incoming triad's match to a set of candidate JI triads, and likewise with tetrads, and etc.
For dyads, the basic harmonic entropy model is fairly simple: it places the dyad we are trying to measure amidst a backdrop of JI candidates. Then, it uses a point-spread function to determine the relative strengths of the match to each, which are then normalized and treated as probabilities. The "entropy" of the resulting probability distribution is a way to measure how closely this distribution tends to focus on one possibility, rather than being spread out among a set of equally-likely possibilities. If there is only one clear choice of dyad which far exceeds all others in probability, the entropy will be lower. If, on the other hand, there are many equally-likely probabilities, the entropy will be higher. The basic harmonic entropy model can also be extended to modeling triads, tetrads, and so on; the standard way to do so is to simply look at the incoming triad's match to a set of candidate JI triads, and likewise with tetrads, and etc.
Line 23: Line 28:
In recent years, it has become clearer that the model can also be very useful in modeling other types of concordance as well, particularly for dyads, where the same model does a very good job in also predicting beatlessness, periodicity buzz, and so on. In particular, Erlich has often suggested the same model, perhaps with slightly different parameters, can also be useful to measure how easy it is to tune a dyad by ear on an instrument such as a guitar, or how much of a sense of being "locked-in" the dyad gives as it is tuned more closely to JI. This may be less related to the perception of virtual fundamentals than it is to beatlessness and so on.
In recent years, it has become clearer that the model can also be very useful in modeling other types of concordance as well, particularly for dyads, where the same model does a very good job in also predicting beatlessness, periodicity buzz, and so on. In particular, Erlich has often suggested the same model, perhaps with slightly different parameters, can also be useful to measure how easy it is to tune a dyad by ear on an instrument such as a guitar, or how much of a sense of being "locked-in" the dyad gives as it is tuned more closely to JI. This may be less related to the perception of virtual fundamentals than it is to beatlessness and so on.


However, it should be noted that the various aspects of psychoacoustic concordance tend to diverge quite strongly in their behavior for larger chords, and thus, when modeling different aspects of psychoacoustic concordance, different ways of generalizing the dyadic model to higher-cardinality chords may be appropriate. In particular, when modelling beatlessness, Erlich has suggested instead looking only at the entropies of the pairwise dyadic subsets of the chord, so that the major and minor chords would be ranked equal in beatlessness, whereas they would not be ranked equal in their ability to produce a clear virtual fundamental (the major chord would be much stronger and lower in entropy).
However, it should be noted that the various aspects of psychoacoustic concordance tend to diverge quite strongly in their behavior for larger chords, and thus, when modeling different aspects of psychoacoustic concordance, different ways of generalizing the dyadic model to higher-cardinality chords may be appropriate. In particular, when modeling beatlessness, Erlich has suggested instead looking only at the entropies of the pairwise dyadic subsets of the chord, so that the major and minor chords would be ranked equal in beatlessness, whereas they would not be ranked equal in their ability to produce a clear virtual fundamental (the major chord would be much stronger and lower in entropy).


=== Concordance vs. actual consonance ===
=== Concordance vs. actual consonance ===
Line 30: Line 35:
While psychoacoustic concordance is not a feature universal to all styles of music, it has been utilized significantly in Western music in the study of intonation. For instance, flexible-pitch ensembles operating within 12-EDO, such as barbershop quartets and string ensembles, will often adjust intonationally from the underlying 12-EDO reference to maximize the concordance of individual chords. Indeed, the entire history of Western tuning theory—from meantone temperament, to the various Baroque well-temperaments, to 12-EDO itself, to the modern [[Regular_Temperaments|theory of regular temperament]]—can be seen as an attempt to reason mathematically about how to generate manageable tuning systems that will maximize concordance and minimize discordance. Consonance and dissonance, on the other hand, is a much more general phenomenon which can even exist in music which is predominantly monophonic and uses no chords at all.
While psychoacoustic concordance is not a feature universal to all styles of music, it has been utilized significantly in Western music in the study of intonation. For instance, flexible-pitch ensembles operating within 12-EDO, such as barbershop quartets and string ensembles, will often adjust intonationally from the underlying 12-EDO reference to maximize the concordance of individual chords. Indeed, the entire history of Western tuning theory—from meantone temperament, to the various Baroque well-temperaments, to 12-EDO itself, to the modern [[Regular_Temperaments|theory of regular temperament]]—can be seen as an attempt to reason mathematically about how to generate manageable tuning systems that will maximize concordance and minimize discordance. Consonance and dissonance, on the other hand, is a much more general phenomenon which can even exist in music which is predominantly monophonic and uses no chords at all.


== Basic Model: Shannon Entropy ==
== Basic model: Shannon entropy ==
The original Harmonic Entropy model limited itself to working with dyads. More recently, work by Steve Martin and others has extended this basic idea to higher-cardinality chords. This article will concern itself with dyads, as the dyadic case is still the most well-developed, and many of the ideas extend naturally to larger chords without need for much exposition.
The original harmonic entropy model limited itself to working with dyads. More recently, work by Steve Martin and others has extended this basic idea to higher-cardinality chords. This article will concern itself with dyads, as the dyadic case is still the most well-developed, and many of the ideas extend naturally to larger chords without need for much exposition.


The general idea of Harmonic Entropy is to first develop a discrete probability distribution quantifying how strongly an arbitrary incoming dyad "matches" every element in a set of basis rational intervals, and then seeing how evenly distributed the resulting probabilities are. If the distribution for some dyad is spread out very evenly, such that there is no clear "victor" basis interval that dominates the distribution, the dyad is considered to be more discordant; on the other extreme, if the distribution tends to concentrate on one or a small set of dyads, the dyad is considered to be more concordant.
The general idea of Harmonic Entropy is to first develop a discrete probability distribution quantifying how strongly an arbitrary incoming dyad "matches" every element in a set of basis rational intervals, and then seeing how evenly distributed the resulting probabilities are. If the distribution for some dyad is spread out very evenly, such that there is no clear "victor" basis interval that dominates the distribution, the dyad is considered to be more discordant; on the other extreme, if the distribution tends to concentrate on one or a small set of dyads, the dyad is considered to be more concordant.
Line 164: Line 169:
An extension to the base Harmonic Entropy model, proposed by Mike Battaglia, is to generalize the use of {{w|Entropy (information_ theory)|Shannon entropy}} by replacing it instead with {{w|Rényi entropy}}, a {{w|q-analog|''q''-analog}} of Shannon's original entropy. This can be thought of as adding a second parameter, called ''a'', to the model, reflecting how "intelligent" the brain's "decoding" process is when determining the most likely JI interpretation of an ambiguous interval.
An extension to the base Harmonic Entropy model, proposed by Mike Battaglia, is to generalize the use of {{w|Entropy (information_ theory)|Shannon entropy}} by replacing it instead with {{w|Rényi entropy}}, a {{w|q-analog|''q''-analog}} of Shannon's original entropy. This can be thought of as adding a second parameter, called ''a'', to the model, reflecting how "intelligent" the brain's "decoding" process is when determining the most likely JI interpretation of an ambiguous interval.


=== Definitions and Background ===
=== Definitions and background ===
The '''Harmonic Rényi entropy of order ''a''''' of an incoming dyad can be defined as follows:
The '''Harmonic Rényi entropy of order ''a''''' of an incoming dyad can be defined as follows:


Line 285: Line 290:
We note that the left factor in the convolution product is always the same ''S''(−''c''), which is not dependent on ''j'' in any way. Since convolution distributes over addition, we can factor the ''S'' out of the summation to obtain
We note that the left factor in the convolution product is always the same ''S''(−''c''), which is not dependent on ''j'' in any way. Since convolution distributes over addition, we can factor the ''S'' out of the summation to obtain


$$\displaystyle \psi(c) = \left[S \ast \left(\sum_{j \in J} \frac{\delta_{-\cent(j)}}{\|j\|}\right)\right](-c)$$
<nowiki>$$\displaystyle \psi(c) = \left[S \ast \left(\sum_{j \in J} \frac{\delta_{-\cent(j)}}{\|j\|}\right)\right](-c)$$</nowiki>
 




We can clean up this notation by defining the auxiliary distribution ''K'':
We can clean up this notation by defining the auxiliary distribution ''K'':


$$\displaystyle K(c) = \sum_{j \in J} \frac{\delta_{-\cent(j)}}{\|j\|}$$
<nowiki>$$\displaystyle K(c) = \sum_{j \in J} \frac{\delta_{-\cent(j)}}{\|j\|}$$</nowiki>
 




Line 296: Line 303:


$$\displaystyle \psi(c) = \left[S \ast K\right](-c)$$
$$\displaystyle \psi(c) = \left[S \ast K\right](-c)$$
If we discretize this to an integer array of cents, give S a standard deviation of 17 cents, and represent all delta functions in K as a vertical line of height 1, we can visualize S and K like so:
[[File:S function.png|alt=S function with a standard deviation of 17 cents|frameless]][[File:K function.png|alt=Visualization of K(c) on 1201 samples for intervals of up to numerator/denominator of 200|frameless]]


==== Convolution product for ρ<sub>a</sub>(''c'') ====
==== Convolution product for ρ<sub>a</sub>(''c'') ====
Line 345: Line 358:


We have succeeded in representing harmonic Rényi entropy in simple terms of two convolution products, each of which can be computed in {{nowrap|''O''(''N'' log ''N'')}} time.
We have succeeded in representing harmonic Rényi entropy in simple terms of two convolution products, each of which can be computed in {{nowrap|''O''(''N'' log ''N'')}} time.
==== Python Example ====
<syntaxhighlight lang="python3" line="1">
import numpy as np
def gaussian(x, stdev):
    return 1.0 / (stdev * np.sqrt(2.0 * np.pi)) * np.exp( -0.5 * (x**2) / (stdev**2) )
x = np.array(range(1201))
intervals = []
interval_weights = []
for i in range(1, 200):
    for j in range(1, 200):
        if np.gcd(i,j) == 1 and 1.0 * i / j >= 1.0 and 1.0 * i / j <= 2.0:
            intervals.append(1.0 * i / j)
            interval_weights.append(np.sqrt(i * j))
intervals = np.array(intervals)
interval_weights = np.array(interval_weights)
intervals_cents = 1200 * np.log2(intervals)
K = np.zeros(len(x))
for i in range(len(intervals)):
    closest_cent = np.rint(intervals_cents[i]).astype(int) # change this if x has non integers
    if K[closest_cent] == 0.0 or K[closest_cent] < 1.0 / interval_weights[i]:
        K[closest_cent] = 1.0 / interval_weights[i]
x_gaussian = range(100)
gaussian_deviation_cents = 17
S = np.array([gaussian(x-50, gaussian_deviation_cents) for x in x_gaussian])
a = 100
reyni_entropy = 1.0 / (1.0 - a) * np.log( np.convolve(K**a, S**a, 'same') / np.convolve(K, S, 'same')**a )
</syntaxhighlight>


== Extending HE to ''N'' {{=}} ∞: zeta-HE ==
== Extending HE to ''N'' {{=}} ∞: zeta-HE ==
Line 363: Line 411:
This enables us to speak cognizantly of the harmonic entropy of an interval as measured against ''all'' rational numbers.
This enables us to speak cognizantly of the harmonic entropy of an interval as measured against ''all'' rational numbers.


=== Background: Unnormalized entropy ===
=== Background: unnormalized entropy ===
Our derivation only analytically continues the entropy function for the "unnormalized" set of probabilities, which we previously wrote as ''Q''(''j''|''c''). For this definition to be philosophically perfect, we would want to analytically continue the entropy function for the normalized sense of probabilities, previously written as ''P''(''j''|''c'').
Our derivation only analytically continues the entropy function for the "unnormalized" set of probabilities, which we previously wrote as ''Q''(''j''|''c''). For this definition to be philosophically perfect, we would want to analytically continue the entropy function for the normalized sense of probabilities, previously written as ''P''(''j''|''c'').


Line 420: Line 468:




Lastly, it so happens that it will be much easier to understand our analytic continuation if we look at the exponential of the UHE times ({{nowrap|1 − a}}), rather than the UHE itself. The reasons for this will become clear later. If we do so, we get
Lastly, it so happens that it will be much easier to understand our analytic continuation if we look at the exponential of the UHE times ({{nowrap|1 − ''a''}}), rather than the UHE itself. The reasons for this will become clear later. If we do so, we get


$$\displaystyle \exp((1-a) \text{UHE}_a(c)) = \left( S^a \ast K^a \right)(-c)$$
$$\displaystyle \exp((1-a) \text{UHE}_a(c)) = \left( S^a \ast K^a \right)(-c)$$
Line 426: Line 474:
Note that this function is simply a monotonic transformation of the original, and so preserves the exact same concordance ranking on all intervals.
Note that this function is simply a monotonic transformation of the original, and so preserves the exact same concordance ranking on all intervals.


==== Analytic Continuation of the Convolution Kernel ====
==== Analytic continuation of the convolution kernel ====
The definition for ''K'' is:
The definition for ''K'' is:


Line 694: Line 742:




However, to see why this doesn't work, let's compare the analytically continued version of the denominator (i.e. the normalization term) with the finite versions. Look at the following picture, which is a plot of <math>\mathcal{F}^{-1}\left\{\overline \phi \cdot |\zeta_{0.5}|^2\right\}^a</math>:
However, to see why this doesn't work, let's compare the analytically continued version of the denominator (i.e. the normalization term) with the finite versions. Look at the following picture, which is a plot of {{nowrap|ℱ{{inv}}{{(}}{{overline|φ}} · {{!}}ζ<sub>0.5</sub>{{!}}<sup>2</sup>{{)}}<sup>''a''</sup>}}:


[[File:HE_normalization_terms.png|800px]]
[[File:HE_normalization_terms.png|800px]]


This picture shows how the denominator changes as ''N'' increases: you can see that in general, the function is shifted upward, increasing without bound. The thin plots reflect this for N=1000, 5000, 10000, 50000, and 100000, where you can see them increasing.
This picture shows how the denominator changes as ''N'' increases: you can see that in general, the function is shifted upward, increasing without bound. The thin plots reflect this for {{nowrap|''N'' {{=}} 1000}}, 5000, 10000, 50000, and 100000, where you can see them increasing.


You will note that the denominator also looks exactly like unnormalized HE, just upside down. Normalized HE is the quotient of two functions that both look like this, which are slightly different. This quotient produces the usual HE curve, which is flipped upside down relative to the denominator, and which also increases without bound. That all these functions increase without bound is just another way to state that these things generally don't converge as <math>N \to \infty</math>.
You will note that the denominator also looks exactly like unnormalized HE, just upside down. Normalized HE is the quotient of two functions that both look like this, which are slightly different. This quotient produces the usual HE curve, which is flipped upside down relative to the denominator, and which also increases without bound. That all these functions increase without bound is just another way to state that these things generally don't converge as {{nowrap|''N'' → ∞}}.


However, look at what happens with our analytic continuation, which is given by the thicker blue line at the bottom. Despite our sequence of finite-''N'' denominator terms increasing on the y-axis, the analytically continued version suddenly "snaps" back to zero. Although the curve shape is roughly the same, the vertical offset is almost completely eliminated when the analytic continuation is done.
However, look at what happens with our analytic continuation, which is given by the thicker blue line at the bottom. Despite our sequence of finite-''N'' denominator terms increasing on the y-axis, the analytically continued version suddenly "snaps" back to zero. Although the curve shape is roughly the same, the vertical offset is almost completely eliminated when the analytic continuation is done.


The problem here is that the original HE function was the quotient of two very large, strictly positive functions - the numerator and denominator. However, performing the analytic continuation on each separately has caused both to "snap" back to zero, so that the denominator, while retaining the same shape, now has points where it touches the x-axis. As a result, the quotient of the two will have poles where the denominator is zero.
The problem here is that the original HE function was the quotient of two very large, strictly positive functions: the numerator and denominator. However, performing the analytic continuation on each separately has caused both to "snap" back to zero, so that the denominator, while retaining the same shape, now has points where it touches the ''x''-axis. As a result, the quotient of the two will have poles where the denominator is zero.


The resulting quotient of analytically continued functions looks like this, and does not remotely resemble HE:
The resulting quotient of analytically continued functions looks like this, and does not remotely resemble HE:
Line 716: Line 764:
But in the case of "normalized HE," we analytically continued the Fourier transforms of the numerator and denominator, separately, transformed both out of the Fourier domain, and then took the quotient. Complex analysis ''really'' makes no guarantee on the behavior of the quotient of two Fourier transforms of the analytic continuations of holomorphic functions, and in this case the behavior is very strange. A different approach to analytically continuing the expression would be required.
But in the case of "normalized HE," we analytically continued the Fourier transforms of the numerator and denominator, separately, transformed both out of the Fourier domain, and then took the quotient. Complex analysis ''really'' makes no guarantee on the behavior of the quotient of two Fourier transforms of the analytic continuations of holomorphic functions, and in this case the behavior is very strange. A different approach to analytically continuing the expression would be required.


This same principle explains why we plotted the exp of UHE, rather than UHE itself. Were we to take the log of finite UHE, we would be taking the log of a strictly positive function. However, the analytically continued exp-UHE snaps back to the x-axis, so that there are points where the function is zero or even negative. Taking the log of the analytically continued exp-UHE would yield a complex-valued function where it is negative, due to this snapping effect. However, looking at exp-UHE directly has no such problem.
This same principle explains why we plotted the exp of UHE, rather than UHE itself. Were we to take the log of finite UHE, we would be taking the log of a strictly positive function. However, the analytically continued exp-UHE snaps back to the ''x''-axis, so that there are points where the function is zero or even negative. Taking the log of the analytically continued exp-UHE would yield a complex-valued function where it is negative, due to this snapping effect. However, looking at exp-UHE directly has no such problem.


Finally, it is noteworthy that for <math>a>2</math>, we end up looking at slices of the zeta function for which <math>\Re(z)>1</math>. This is where our original unnormalized HE function should converge as <math>N \to \infty</math>, corresponding to the region where the Riemann zeta function Dirichlet series converges. For these values of ''a'', the exp-UHE ''is'' positive. So, we can take the log again and look at the usual UHE. This can be useful for plotting, since exp-UHE tends to "flatten" out the curve for high values of ''a'', whereas taking the log accentuates the minima and maxima (and more closely resembles the usual HRE).
Finally, it is noteworthy that for {{nowrap|''a'' &gt; 2}}, we end up looking at slices of the zeta function for which {{nowrap|Re(''z'') &gt; 1}}. This is where our original unnormalized HE function should converge as {{nowrap|''N'' → ∞}}, corresponding to the region where the Riemann zeta function Dirichlet series converges. For these values of ''a'', the exp-UHE ''is'' positive. So, we can take the log again and look at the usual UHE. This can be useful for plotting, since exp-UHE tends to "flatten" out the curve for high values of ''a'', whereas taking the log accentuates the minima and maxima (and more closely resembles the usual HRE).


=== Interpretation as a New Free Parameter: the Weighting Exponent ===
=== Interpretation as a new free parameter: the weighting exponent ===
In our original derivation of the analytic continuation, we temporarily changed the weighting for rationals from <math>(nd)^{0.5}</math> to some other <math>(nd)^w</math>, with <math>w > 1</math>, for the sake of obtaining a series that converges. We then changed the exponent back to <math>0.5</math>.
In our original derivation of the analytic continuation, we temporarily changed the weighting for rationals from (''nd'')<sup>0.5</sup> to some other (''nd'')<sup>''w''</sup>, with {{nowrap|''w'' &gt; 1}}, for the sake of obtaining a series that converges. We then changed the exponent back to 0.5.


This can be thought of as giving us another free parameter to HE, in addition to ''s'' and ''a'': the exponent for the weighting for each rational. That is, although Paul originally derived the <math>(nd)^{0.5}</math> exponent empirically by studying the behavior of mediant-to-mediant HE for Tenney-bounded rationals, there is no reason we can't simply that exponent to something else. As shown before, so long as that exponent is greater than 1, unnormalized HE will converge in the limit as <math>N -> \infty</math>, and will converge to the same thing whether we are bounding <math>nd < N</math>, <math>\max(n,d) < N</math>, or anything else (see again [https://math.stackexchange.com/questions/2593993/convergence-of-product-of-series-to-zeta-function here]). We can then analytically continue to the case where <math>w < 1</math>.
This can be thought of as giving us another free parameter to HE, in addition to ''s'' and ''a'': the exponent for the weighting for each rational. That is, although Paul originally derived the (''nd'')<sup>0.5</sup> exponent empirically by studying the behavior of mediant-to-mediant HE for Tenney-bounded rationals, there is no reason we can't simply that exponent to something else. As shown before, so long as that exponent is greater than 1, unnormalized HE will converge in the limit as {{nowrap|''N'' → ∞}}, and will converge to the same thing whether we are bounding {{nowrap|''nd'' &lt; ''N''}}, {{nowrap|max(''n'', ''d'') &lt; ''N''}}, or anything else (see again [https://math.stackexchange.com/questions/2593993/convergence-of-product-of-series-to-zeta-function here]). We can then analytically continue to the case where {{nowrap|''w'' &lt; 1}}.


If we add this as a third parameter, called ''w'' we can modify our definition of exp-UHE as follows:
If we add this as a third parameter, called ''w'' we can modify our definition of exp-UHE as follows:
Line 729: Line 777:
$$\displaystyle \exp((1-a) \text{UHE}_{a,w}(n)) = \mathcal{F}^{-1}\left\{\overline \phi_a \cdot |\zeta_{w a}|^2\right\}$$
$$\displaystyle \exp((1-a) \text{UHE}_{a,w}(n)) = \mathcal{F}^{-1}\left\{\overline \phi_a \cdot |\zeta_{w a}|^2\right\}$$


So that our vertical slice of the zeta function is given by $\Re(z) = w\cdot \a$.
So that our vertical slice of the zeta function is given by {{nowrap|Re(''z'') {{=}} ''wa''}}.
 
=== Equivalence of the Weighting Exponent and ''a'' for Generalized Normal Distributions ===


We get a very interesting result if our spreading distribution is a [https://en.wikipedia.org/wiki/Generalized_normal_distribution generalized normal distribution], which a family that encompasses both the Gaussian and the Laplace distributions (sometimes referred to as the "Vos curve" in Paul's work).
=== Equivalence of the weighting exponent and ''a'' for generalized normal distributions ===
We get a very interesting result if our spreading distribution is a {{w|generalized normal distribution}}, which a family that encompasses both the Gaussian and the Laplace distributions (sometimes referred to as the "Vos curve" in Paul's work).


Let's go back to our three-parameter definition of exp-UHE above:
Let's go back to our three-parameter definition of exp-UHE above:
Line 739: Line 786:
$$\displaystyle \exp((1-a) \text{UHE}_{a,w}(n)) = \mathcal{F}^{-1}\left\{\overline \phi_a \cdot |\zeta_{w a}|^2\right\}$$
$$\displaystyle \exp((1-a) \text{UHE}_{a,w}(n)) = \mathcal{F}^{-1}\left\{\overline \phi_a \cdot |\zeta_{w a}|^2\right\}$$


We can see that, in a sense, the need for both ''a'' and ''w'' is almost redundant. Their product specifies the vertical slice of the zeta function. If you set <math>w=0.5</math> and <math>a=1</math>, corresponding to the Shannon entropy with <math>\sqrt{nd}</math> weighting, you get the same vertical slice as if you set <math>w=0.25</math> and <math>a=2</math>, corresponding to the collision entropy with <math>^4\sqrt{nd}</math> weighting: in both cases this is the critical line of the zeta function.
We can see that, in a sense, the need for both ''a'' and ''w'' is almost redundant. Their product specifies the vertical slice of the zeta function. If you set {{nowrap|''w'' {{=}} 0.5}} and {{nowrap|''a'' {{=}} 1}}, corresponding to the Shannon entropy with <math>\sqrt{nd}</math> weighting, you get the same vertical slice as if you set {{nowrap|''w'' {{=}} 0.25}} and {{nowrap|''w'' {{=}} 2}}, corresponding to the collision entropy with <math>^4\sqrt{nd}</math> weighting: in both cases this is the critical line of the zeta function.


The only reason that these expressions are different is due to the <math>\phi_a</math> above. We had previously defined that as:
The only reason that these expressions are different is due to the φ<sub>''a''</sub> above. We had previously defined that as:


$$\displaystyle \phi_a(t) = \mathcal{F}\left\{S(n)^a\right\}(t)$$
$$\displaystyle \phi_a(t) = \mathcal{F}\left\{S(n)^a\right\}(t)$$


or, the Fourier transform of the spreading distribution, raised to the power of ''a''. So if you hold the product <math>w a</math> as constant, but change the balance of ''w'' and ''a'', you will indeed get different results, simply because only the choice of ''a'' changes the <math>\phi_a</math>.
or, the Fourier transform of the spreading distribution, raised to the power of ''a''. So if you hold the product ''wa'' as constant, but change the balance of ''w'' and ''a'', you will indeed get different results, simply because only the choice of ''a'' changes the φ<sub>''a''</sub>.


However, we get a very neat result if we are using the generalized normal distribution. In that case, if we take the generalized normal distribution to a power ''a'', we get another instance of the same generalized normal distribution. The difference is, the variance will be divided by <math>a^{\frac{1}{\beta}}</math>, where <math>\beta</math> is the shape parameter for the distribution (a value of 1 is the Laplace distribution, a value of 2 is the Gaussian distribution, etc). The whole distribution will also no longer have an integral of 1, since we have also raised the scaling coefficient to a power, but this won't change anything, as it just corresponds to a uniform scaling of the end result.
However, we get a very neat result if we are using the generalized normal distribution. In that case, if we take the generalized normal distribution to a power ''a'', we get another instance of the same generalized normal distribution. The difference is, the variance will be divided by ''a''<sup>{{frac|1}}</sup>, where β is the shape parameter for the distribution (a value of 1 is the Laplace distribution, a value of 2 is the Gaussian distribution, etc). The whole distribution will also no longer have an integral of 1, since we have also raised the scaling coefficient to a power, but this won't change anything, as it just corresponds to a uniform scaling of the end result.


In practice, what this means is that if you are using one of the above distributions, and you change ''a'', this is ''equivalent'' to changing the weighting exponent ''w'', and tweaking the standard deviation ''s'' according to the above equation.
In practice, what this means is that if you are using one of the above distributions, and you change ''a'', this is ''equivalent'' to changing the weighting exponent ''w'', and tweaking the standard deviation ''s'' according to the above equation.


This gives us a very nice interpretation of our ''a'' coefficient from HRE: it basically represents the weighting exponent on the rationals, with a corresponding adjustment to the standard deviation. The collision entropy <math>a=2</math> with the standard weighting <math>\sqrt{nd}</math> is totally equivalent to the Shannon entropy <math>a=1</math> with the weighting ''nd'' on the rationals, so long as the value of ''s'' is adjusted according to the equation above. However, it should be noted that this definition only holds for the "unnormalized HRE" given above.
This gives us a very nice interpretation of our ''a'' coefficient from HRE: it basically represents the weighting exponent on the rationals, with a corresponding adjustment to the standard deviation. The collision entropy {{nowrap|''a'' {{=}} 2}} with the standard weighting <math>\sqrt{nd}</math> is totally equivalent to the Shannon entropy {{nowrap|''a'' {{=}} 1}} with the weighting ''nd'' on the rationals, so long as the value of ''s'' is adjusted according to the equation above. However, it should be noted that this definition only holds for the "unnormalized HRE" given above.
 
=== Reduced Rationals Only ===


=== Reduced rationals only ===
In our derivation, we assumed the use of unreduced rationals. It turns out that with a minor adjustment, the same model gives us reduced rationals, up to a constant multiplicative scaling. Let's go back to our analytic continuation of the convolution kernel, for some arbitrary weighting:
In our derivation, we assumed the use of unreduced rationals. It turns out that with a minor adjustment, the same model gives us reduced rationals, up to a constant multiplicative scaling. Let's go back to our analytic continuation of the convolution kernel, for some arbitrary weighting:


$$\displaystyle \mathcal{F}\left\{K(n)\right\}(t) = \sum_{j \in J} \frac{e^{i  t \log (j_n/j_d)}}{(j_n \cdot j_d)^{w}}$$
$$\displaystyle \mathcal{F}\left\{K(n)\right\}(t) = \sum_{j \in J} \frac{e^{i  t \log (j_n/j_d)}}{(j_n \cdot j_d)^{w}}$$


Now, suppose we want to analytically continue this so that the set ''J'' is the set of all reduced rational numbers. We can first do so by starting again with unreduced rationals, but expressing each rational not as <math>\frac{n}{d}</math>, but rather as <math>\frac{n}{d} \cdot \frac{c}{c}</math>, where <math>n'</math> and <math>d'</math> are coprime, and ''c'' is the gcd of both. For example, we would express <math>\frac{6}{4}</math> as <math>\frac{3}{2} \cdot \frac{2}{2}</math>. Doing so, and assuming that we denote the set of unreduced rationals by <math>\mathbb{U}</math>, we get the following equivalent expression of the same convolution kernel above:
Now, suppose we want to analytically continue this so that the set ''J'' is the set of all reduced rational numbers. We can first do so by starting again with unreduced rationals, but expressing each rational not as {{sfrac|''n''|''d''}}, but rather as {{nowrap|{{sfrac|''n''{{``}}|''d''{{-`}}}} · {{sfrac|''c''|''c''}}}}, where ''n''{{``}} and ''d''{{-`}} are coprime, and ''c'' is the GCD of both. For example, we would express {{sfrac|6|4}} as {{nowrap|{{sfrac|3|2}} · {{sfrac|2|2}}}}. Doing so, and assuming that we denote the set of unreduced rationals by ''U'', we get the following equivalent expression of the same convolution kernel above:


$$\displaystyle \mathcal{F}\left\{K(n)\right\}(t) = \sum_{j \in \mathbb{U}} \frac{e^{i  t \log (\frac{j_c j_{n'}}{j_c j_{d'}})}}{(j_c j_{n'} \cdot j_c j_{d'})^{w}} = |\zeta(w+i t)|^2$$
$$\displaystyle \mathcal{F}\left\{K(n)\right\}(t) = \sum_{j \in \mathbb{U}} \frac{e^{i  t \log (\frac{j_c j_{n'}}{j_c j_{d'}})}}{(j_c j_{n'} \cdot j_c j_{d'})^{w}} = |\zeta(w+i t)|^2$$
Line 769: Line 815:
$$\displaystyle |\zeta(w+i t)|^2 = \sum_{j \in \mathbb{U}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{({j_c}^2 \cdot j_{n'} j_{d'})^{w}} = \sum_{j \in \mathbb{U}} \left[ \frac{1}{{j_c}^{2w}} \cdot \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}} \right]$$
$$\displaystyle |\zeta(w+i t)|^2 = \sum_{j \in \mathbb{U}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{({j_c}^2 \cdot j_{n'} j_{d'})^{w}} = \sum_{j \in \mathbb{U}} \left[ \frac{1}{{j_c}^{2w}} \cdot \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}} \right]$$


Now, assuming we have <math>w>1</math> and everything is absolutely convergent, we can factor this into a product of series as follows:
Now, assuming we have {{nowrap|''w'' &gt; 1}} and everything is absolutely convergent, we can factor this into a product of series as follows:


$$\displaystyle |\zeta(w+i t)|^2 = \left[ \sum_{j_c \in \mathbb{N}^+} \frac{1}{{j_c}^{2w}} \right] \cdot \left[ \sum_{j \in \mathbb{Q}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}} \right]$$
$$\displaystyle |\zeta(w+i t)|^2 = \left[ \sum_{j_c \in \mathbb{N}^+} \frac{1}{{j_c}^{2w}} \right] \cdot \left[ \sum_{j \in \mathbb{Q}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}} \right]$$


where the left summation now has <math>j_c \in \mathbb{N}^+</math>, the set of strictly positive rational numbers, and the right summation now has <math>j \in \mathbb{Q}</math> the set of reduced rationals. Note again that the product above yields all unreduced rationals, thanks to the ''j_c''.
where the left summation now has {{nowrap|''j''<sub>''c''</sub> ∈ ℕ{{+}}}}, the set of strictly positive rational numbers, and the right summation now has {{nowrap|''j'' ∈ ℚ}} the set of reduced rationals. Note again that the product above yields all unreduced rationals, thanks to the ''j''<sub>''c''</sub>.


Now, note that that left series is, itself, just another Dirichlet series that converges to the zeta function. We have
Now, note that that left series is, itself, just another Dirichlet series that converges to the zeta function. We have
Line 779: Line 825:
$$\displaystyle |\zeta(w+i t)|^2 = \zeta(2w) \cdot \left[ \sum_{j \in \mathbb{Q}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}} \right]$$
$$\displaystyle |\zeta(w+i t)|^2 = \zeta(2w) \cdot \left[ \sum_{j \in \mathbb{Q}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}} \right]$$


and now we are done. The right series is the thing that we want, representing the Fourier transform of the convolution kernel where only reduced fractions are allowed. To get that, we simply divide the whole thing by <math>\zeta(2w)</math>:
and now we are done. The right series is the thing that we want, representing the Fourier transform of the convolution kernel where only reduced fractions are allowed. To get that, we simply divide the whole thing by ζ(2''w''):


$$\displaystyle \frac{|\zeta(w+i t)|^2}{\zeta(2w)} = \sum_{j \in \mathbb{Q}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}}$$
$$\displaystyle \frac{|\zeta(w+i t)|^2}{\zeta(2w)} = \sum_{j \in \mathbb{Q}} \frac{e^{i  t \log (\frac{j_{n'}}{j_{d'}})}}{(j_{n'} j_{d'})^{w}}$$


This function then becomes our new <math>\mathcal{F}\left\{K(n)\right\}</math>.
This function then becomes our new {''K''(''n'')}.


However, you will note that <math>\zeta(2w)</math> is a constant not depending at all on ''t''. As a result, the reduced rational kernel is exactly equal to the unreduced rational kernel, times a constant depending only on ''w''. This means that when we take the inverse Fourier transform and convolve, the result for exp-UHE will likewise be identical, scaled only by a constant.
However, you will note that ζ(2''w'') is a constant not depending at all on ''t''. As a result, the reduced rational kernel is exactly equal to the unreduced rational kernel, times a constant depending only on ''w''. This means that when we take the inverse Fourier transform and convolve, the result for exp-UHE will likewise be identical, scaled only by a constant.


As a result, we have shown that we get the same exact results for reduced and unreduced rationals, differing only by a multiplicative scaling.
As a result, we have shown that we get the same exact results for reduced and unreduced rationals, differing only by a multiplicative scaling.


Lastly, you will note that for the special value <math>w=0.5</math>, corresponding to the usual <math>\sqrt{nd}</math> weighting, we end up dividing by the term <math>\zeta(1)</math>. This is the only pole in the zeta function, so we wind up dividing by infinity, making the entire function zero, as pointed out by Martin Gough. However, as we can get arbitrarily close to <math>w=0.5</math> and still exhibit the behavior that the unreduced and reduced functions are scaled versions of one another, we can simply use the unreduced version of exp-UHE for <math>w=0.5</math> and consider it equivalent to reduced exp-UHE in the limit.
Lastly, you will note that for the special value {{nowrap|''w'' {{=}} 0.5}}, corresponding to the usual <math>\sqrt{nd}</math> weighting, we end up dividing by the term ζ(1). This is the only pole in the zeta function, so we wind up dividing by infinity, making the entire function zero, as pointed out by Martin Gough. However, as we can get arbitrarily close to {{nowrap|''w'' {{=}} 0.5}} and still exhibit the behavior that the unreduced and reduced functions are scaled versions of one another, we can simply use the unreduced version of exp-UHE for {{nowrap|''w'' {{=}} 0.5}} and consider it equivalent to reduced exp-UHE in the limit.
 
== To Do ==
There are a number of things that need to be added to this article. Below are listed some for reference:
 
* 3HE, both for finite HE and for <math>N \to \infty</math>
* write-up of fast computation for infinite zeta-UHE, perhaps with a zeta table
* addition of many more pictures


== References ==
== References ==
Line 804: Line 843:
* [https://yahootuninggroupsultimatebackup.github.io/harmonic_entropy Harmonic entropy group on Yahoo] (archive)
* [https://yahootuninggroupsultimatebackup.github.io/harmonic_entropy Harmonic entropy group on Yahoo] (archive)
* [http://www.mikebattagliamusic.com/HE-JS/HE.html Harmonic entropy graph calculator (JavaScript)]
* [http://www.mikebattagliamusic.com/HE-JS/HE.html Harmonic entropy graph calculator (JavaScript)]
== See also ==
* [[Harmonic entropy of just intervals]]
* [[Low harmonic entropy linear temperaments]]
* [[User:Sintel/Validation of common consonance measures]] — an informal empirical study which calls into question the effectiveness of harmonic entropy for explaining [[consonance]]
== Todo ==
{{todo|inline=1|complete section|text=Add 3HE, both for finite HE and for ''N'' → ∞.}}
{{todo|inline=1|complete section|add table|text=Write-up of fast computation for infinite zeta-UHE, perhaps with a zeta table.}}
{{todo|inline=1|add illustration|text=Addition of many more pictures.}}


[[Category:Terms]]
[[Category:Terms]]
Line 809: Line 858:
[[Category:Consonance and dissonance]]
[[Category:Consonance and dissonance]]
[[Category:Harmonic entropy| ]] <!-- main article -->
[[Category:Harmonic entropy| ]] <!-- main article -->
[[Category:Book-style articles]]
[[Category:Essays]]