Harmonic entropy: Difference between revisions

Mike Battaglia (talk | contribs)
Header cleanup
Mike Battaglia (talk | contribs)
More cleanup of headers
Line 27: Line 27:
Concordance has often been confused with actual musical consonance, an unfortunate fact made more common by the psychoacoustics literature under the unfortunate name '''sensory consonance''', most often used to refer to phenomena related to roughness and beatlessness specifically. This is not to be confused with the more familiar construct of tonal stability, typically just called "consonance" in Western common practice music theory and sometimes clarified as "musical consonance" in the music cognition literature. To make matters worse, the literature has also at times referred to concordance -- and not tonal stability -- as '''tonal consonance''', often referring to phenomena related to virtual pitch integration, creating a complete terminological mess. As a result, the term "consonance" has been completely avoided in this article.
Concordance has often been confused with actual musical consonance, an unfortunate fact made more common by the psychoacoustics literature under the unfortunate name '''sensory consonance''', most often used to refer to phenomena related to roughness and beatlessness specifically. This is not to be confused with the more familiar construct of tonal stability, typically just called "consonance" in Western common practice music theory and sometimes clarified as "musical consonance" in the music cognition literature. To make matters worse, the literature has also at times referred to concordance -- and not tonal stability -- as '''tonal consonance''', often referring to phenomena related to virtual pitch integration, creating a complete terminological mess. As a result, the term "consonance" has been completely avoided in this article.


=Basic Model=
=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.


Line 34: Line 34:
A clear mathematical way of quantifying this "dispersion" is via the [http://en.wikipedia.org/wiki/Entropy_(information_theory) Shannon entropy] of the probability distribution, which can be thought of as describing the "uncertainty" in the distribution. A distribution which has a very high probability of picking one outcome has low entropy and is not very uncertain, whereas a distribution which has the probability spread out on many outcomes is highly uncertain and has a high entropy.
A clear mathematical way of quantifying this "dispersion" is via the [http://en.wikipedia.org/wiki/Entropy_(information_theory) Shannon entropy] of the probability distribution, which can be thought of as describing the "uncertainty" in the distribution. A distribution which has a very high probability of picking one outcome has low entropy and is not very uncertain, whereas a distribution which has the probability spread out on many outcomes is highly uncertain and has a high entropy.


==Definitions==
To formalize our notion of Shannon entropy, we will first describe the random variable <math>J</math>, representing the set of JI "basis" intervals that our incoming interval is being "matched" to, and the parameter <math>C</math>, representing the "cents" of the incoming interval being played. For example, the interval <math>C</math> would take values such as "400 cents," and the interval <math>J</math> would take values in the set of basis ratios, such as "5/4" or "9/7."
To formalize our notion of Shannon entropy, we will first describe the random variable <math>J</math>, representing the set of JI "basis" intervals that our incoming interval is being "matched" to, and the parameter <math>C</math>, representing the "cents" of the incoming interval being played. For example, the interval <math>C</math> would take values such as "400 cents," and the interval <math>J</math> would take values in the set of basis ratios, such as "5/4" or "9/7."


Line 66: Line 67:
which makes more explicit that <math>c</math> is the argument to the harmonic entropy function, which is equal to the entropy of <math>J</math>, conditioned on <math>C=c</math>.
which makes more explicit that <math>c</math> is the argument to the harmonic entropy function, which is equal to the entropy of <math>J</math>, conditioned on <math>C=c</math>.


=Probability Distributions=
==Probability Distributions==


In order to systematically assign a probability distribution to this dyad, we first start by defining a '''spreading function''', denoted by <math>S(x)</math>, that dictates how the dyad is "smeared" out in log-frequency space, representing how the auditory system allows for some tolerance for mistuning. The typical choice that we will assume here for a spreading function is a Gaussian distribution, with mean centered around the incoming dyad, and standard deviation typically taken as a free parameter in the system and denoted as <math>s</math>.
In order to systematically assign a probability distribution to this dyad, we first start by defining a '''spreading function''', denoted by <math>S(x)</math>, that dictates how the dyad is "smeared" out in log-frequency space, representing how the auditory system allows for some tolerance for mistuning. The typical choice that we will assume here for a spreading function is a Gaussian distribution, with mean centered around the incoming dyad, and standard deviation typically taken as a free parameter in the system and denoted as <math>s</math>.
Line 91: Line 92:
Given a spreading function and set of basis rationals, there are two different procedures commonly used to assign probabilities to each rational. The first, the '''domain-integral approach''', works for arbitrary nowhere dense sets of rationals without any further free parameters. The second, the '''complexity-normalization approach''', has nice mathematical properties which sometimes make it easier to compute and which may lead to generalizations to infinite sets of rationals which are sometimes dense in the reals. It is conjectured that there are certain important limiting situations where the two converge; both are described in detail below.
Given a spreading function and set of basis rationals, there are two different procedures commonly used to assign probabilities to each rational. The first, the '''domain-integral approach''', works for arbitrary nowhere dense sets of rationals without any further free parameters. The second, the '''complexity-normalization approach''', has nice mathematical properties which sometimes make it easier to compute and which may lead to generalizations to infinite sets of rationals which are sometimes dense in the reals. It is conjectured that there are certain important limiting situations where the two converge; both are described in detail below.


==Domain-Integral Probabilities==
===Domain-Integral Probabilities===
For sets of JI basis rationals which are nowhere dense, and in particular for a finite set of basis rationals, the log-frequency spectrum can be divided up into '''domains''' assigned to each ratio. Each ratio is assigned a domain with lower bound equal to the mediant of itself and its nearest lower neighbor, and likewise with upper bound equal to the mediant of itself and its nearest upper neighbor. If no such neighbor exists, <math>\pm \infty</math> is used instead. Mathematically, this can be represented via the following expression:
For discrete sets of JI basis ratios, the log-frequency spectrum can be divided up into '''domains''' assigned to each ratio. Each ratio is assigned a domain with lower bound equal to the mediant of itself and its nearest lower neighbor, and likewise with upper bound equal to the mediant of itself and its nearest upper neighbor. If no such neighbor exists, <math>\pm \infty</math> is used instead. Mathematically, this can be represented via the following expression:




Line 107: Line 108:
In the case where the set of basis rationals consists of a finite set bounded by Tenney or Weil height, the resulting set of widths is conjectured to have interesting mathematical properties, leading to mathematically nice conceptual simplifications of the model. These simplifications are explained below.
In the case where the set of basis rationals consists of a finite set bounded by Tenney or Weil height, the resulting set of widths is conjectured to have interesting mathematical properties, leading to mathematically nice conceptual simplifications of the model. These simplifications are explained below.


==Complexity-Normalization Probabilities==
===Complexity-Normalization Probabilities===
It has been noted empirically by Paul Erlich that, given all those rationals with Tenney height under some cutoff <math>N</math> as a basis set, that the domain widths for rationals sufficiently far from the cutoff seem to be proportional to <math>\frac{1}{\sqrt{nd}}</math>.
It has been noted empirically by Paul Erlich that, given all those rationals with Tenney height under some cutoff <math>N</math> as a basis set, that the domain widths for rationals sufficiently far from the cutoff seem to be proportional to <math>\frac{1}{\sqrt{nd}}</math>.


Line 138: Line 139:
This approach to assigning probabilities to basis rationals is useful because it hypothetically makes it possible to consider the HE of sets of rationals which are dense in the reals, or even the entire set of positive rationals, although the best way to do this is a subject of ongoing research.
This approach to assigning probabilities to basis rationals is useful because it hypothetically makes it possible to consider the HE of sets of rationals which are dense in the reals, or even the entire set of positive rationals, although the best way to do this is a subject of ongoing research.


=Examples=
==Examples==


In all of these examples, the x-axis represents the width in cents of the dyad, and the y-axis represents ''discordance'' rather than concordance, measured in nats of Shannon entropy.
In all of these examples, the x-axis represents the width in cents of the dyad, and the y-axis represents ''discordance'' rather than concordance, measured in nats of Shannon entropy.


=== s=17, N<10000, sqrt(n*d) weights ===
This uses as a spreading function the Gaussian distribution with <math>s=~17\cent</math> (or a lin-frequency deviation of 1%). The basis set is all rationals of Tenney height less than 10,000. This uses the complexity-normalization approach, and the complexity function is <math>\sqrt{nd}</math>:
This uses as a spreading function the Gaussian distribution with <math>s=~17\cent</math> (or a lin-frequency deviation of 1%). The basis set is all rationals of Tenney height less than 10,000. This uses the complexity-normalization approach, and the complexity function is <math>\sqrt{nd}</math>:


[[File:HE_Tenney_N_10000_s_17cents.png]]
[[File:HE_Tenney_N_10000_s_17cents.png]]


=== s=17, N<100, max(n,d) weights ===
This example uses the same spreading function and standard deviation, but this time the basis set is all rationals of Weil height less than 100. The complexity function here is <math>\max(n,d)</math>:
This example uses the same spreading function and standard deviation, but this time the basis set is all rationals of Weil height less than 100. The complexity function here is <math>\max(n,d)</math>:


[[File:HE_Weil_N_100_s_17cents.png]]
[[File:HE_Weil_N_100_s_17cents.png]]


=== s=17, N<10000, sqrt(n*d) vs mediant-to-mediant weights ===
The following image (from Paul Erlich) compares the domain-integral and complexity-normalization approaches by overlaying the two curves on top of each other. In both cases, the spreading function is again a Gaussian with s=~17 cents, and the basis set is all those rationals with Tenney height ≤ 10000. It can be seen that the curves are extremely similar, and that the locations of the minima and maxima are largely preserved:
The following image (from Paul Erlich) compares the domain-integral and complexity-normalization approaches by overlaying the two curves on top of each other. In both cases, the spreading function is again a Gaussian with s=~17 cents, and the basis set is all those rationals with Tenney height ≤ 10000. It can be seen that the curves are extremely similar, and that the locations of the minima and maxima are largely preserved:


Line 156: Line 160:
=Harmonic Rényi Entropy=
=Harmonic Rényi Entropy=


An extension to the base Harmonic Entropy model, proposed by Mike Battaglia, is to generalize the use of [http://en.wikipedia.org/wiki/Entropy_(information_theory) Shannon entropy] by replacing it instead with [http://en.wikipedia.org/wiki/R%C3%A9nyi_entropy Rényi entropy], a [http://en.wikipedia.org/wiki/Q-analog q-analog] of Shannon's original entropy. The '''Harmonic Rényi Entropy of order a''' of an incoming dyad can be defined as follows:
An extension to the base Harmonic Entropy model, proposed by Mike Battaglia, is to generalize the use of [http://en.wikipedia.org/wiki/Entropy_(information_theory) Shannon entropy] by replacing it instead with [http://en.wikipedia.org/wiki/R%C3%A9nyi_entropy Rényi entropy], a [http://en.wikipedia.org/wiki/Q-analog q-analog] of Shannon's original entropy. This can be thought of as adding a second parameter, called <math>a</math>, 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==
 
The '''Harmonic Rényi Entropy of order a''' of an incoming dyad can be defined as follows:


<math>\text{HE}_a(c) = H_a(J=j|C=c) = \frac{1}{1-a} \log \sum_{j \in J} P(J=j|C=c)^a</math>
<math>\text{HE}_a(c) = H_a(J=j|C=c) = \frac{1}{1-a} \log \sum_{j \in J} P(J=j|C=c)^a</math>
Line 170: Line 178:
Some psychoacoustic effects naturally fit into this paradigm, such as the virtual pitch integration process, which actually does attempt to find a single victor when matching incoming chords with chunks of the harmonic series. Other psychoacoustic effects, such as that of beatlessness, may instead be better viewed as "dumb" processes whereby nothing in particular is being "chosen," but where a more uniform distribution of matching rational numbers for a dyad simply generates a more discordant sonic effect. Different values of a can differentiate between the predominance given to these two types of effect in the overall construct of psychoacoustic concordance.
Some psychoacoustic effects naturally fit into this paradigm, such as the virtual pitch integration process, which actually does attempt to find a single victor when matching incoming chords with chunks of the harmonic series. Other psychoacoustic effects, such as that of beatlessness, may instead be better viewed as "dumb" processes whereby nothing in particular is being "chosen," but where a more uniform distribution of matching rational numbers for a dyad simply generates a more discordant sonic effect. Different values of a can differentiate between the predominance given to these two types of effect in the overall construct of psychoacoustic concordance.


Certain values of <math>a</math> reduce to simpler expressions and have special names.
Certain values of <math>a</math> reduce to simpler expressions and have special names, as given in the examples below.


==a=0: Harmonic Hartley Entropy==
==Examples==
===a=0: Harmonic Hartley Entropy===
<math>H_0(J|C=c) = \log |J|</math>
<math>H_0(J|C=c) = \log |J|</math>


Line 181: Line 190:
''Harmonic Hartley Entropy (a=0) with the basis set all rationals with Tenney height ≤ 10000. Note that the choice of spreading function makes no difference in the end result at all.''
''Harmonic Hartley Entropy (a=0) with the basis set all rationals with Tenney height ≤ 10000. Note that the choice of spreading function makes no difference in the end result at all.''


==a=1: Harmonic Shannon Entropy (Harmonic Entropy)==
===a=1: Harmonic Shannon Entropy (Harmonic Entropy)===
<math>H_1(J|C=c) = -\sum_{j \in J} P(J=j|C=c) \log P(J=j|C=c)</math>
<math>H_1(J|C=c) = -\sum_{j \in J} P(J=j|C=c) \log P(J=j|C=c)</math>


Line 190: Line 199:
''Harmonic Shannon Entropy (a=1) with the basis set all rationals with Tenney height ≤ 10000, spreading function a Gaussian distribution with s=1% (~17 cents), and <math>\sqrt{nd}</math> complexity.''
''Harmonic Shannon Entropy (a=1) with the basis set all rationals with Tenney height ≤ 10000, spreading function a Gaussian distribution with s=1% (~17 cents), and <math>\sqrt{nd}</math> complexity.''


==a=2: Harmonic Collision Entropy==
===a=2: Harmonic Collision Entropy===
<math>H_2(J=j|C=c) = -\log \sum_{j \in J} P(J=j|C=c)^2 = -\log (J_1 = J_2|C=c)</math>
<math>H_2(J=j|C=c) = -\log \sum_{j \in J} P(J=j|C=c)^2 = -\log (J_1 = J_2|C=c)</math>


Line 199: Line 208:
''Harmonic Collision Entropy (a=2) with the basis set all rationals with Tenney height ≤ 10000, spreading function a Gaussian distribution with s=1% (~17 cents), and <math>\sqrt{nd}</math> complexity.''
''Harmonic Collision Entropy (a=2) with the basis set all rationals with Tenney height ≤ 10000, spreading function a Gaussian distribution with s=1% (~17 cents), and <math>\sqrt{nd}</math> complexity.''


==a=∞: Harmonic Min-Entropy==
===a=∞: Harmonic Min-Entropy===
<math>H_\infty(J=j|C=c) = -\log \max_{j \in J} P(J=j|C=c)</math>
<math>H_\infty(J=j|C=c) = -\log \max_{j \in J} P(J=j|C=c)</math>


Line 208: Line 217:
''Harmonic Rényi Entropy with a=7, with the high value of a being chosen to approximate min-entropy (a=''∞''). The basis set is still all rationals with Tenney height ≤ 10000, the spreading function a Gaussian distribution with s=1% (~17 cents), and the complexity function <math>\sqrt{nd}</math>.''
''Harmonic Rényi Entropy with a=7, with the high value of a being chosen to approximate min-entropy (a=''∞''). The basis set is still all rationals with Tenney height ≤ 10000, the spreading function a Gaussian distribution with s=1% (~17 cents), and the complexity function <math>\sqrt{nd}</math>.''


=Convolution-Based Expression For Quickly Computing Renyi Entropy=
==Convolution-Based Expression For Quickly Computing Renyi Entropy==
Below is given an derivation that expresses Harmonic Renyi Entropy in terms of two simpler functions, each of which is a convolution product and hence can be computed quickly using the Fast Fourier Transform.
Below is given an derivation that expresses Harmonic Renyi Entropy in terms of two simpler functions, each of which is a convolution product and hence can be computed quickly using the Fast Fourier Transform.


The below derivation depends on the use of complexity-normalization probabilities, although it may be possible to extend to domain-integral probabilities instead.
The below derivation depends on the use of complexity-normalization probabilities, although it may be possible to extend to domain-integral probabilities instead.


==Preliminaries==
===Preliminaries===
The Harmonic Renyi Entropy is defined as
The Harmonic Renyi Entropy is defined as


Line 252: Line 261:
We thus reduce the term inside the logarithm to the quotient of the functions <math>\rho_a(c)</math> and <math>\psi(c)</math>. Our aim is now to express each of these two functions in terms of a convolution product.
We thus reduce the term inside the logarithm to the quotient of the functions <math>\rho_a(c)</math> and <math>\psi(c)</math>. Our aim is now to express each of these two functions in terms of a convolution product.


==Convolution product for <math>\psi(c)</math>==
===Convolution product for <math>\psi(c)</math>===
<math>\psi(c)</math>, the normalization function, is written as follows:
<math>\psi(c)</math>, the normalization function, is written as follows:


Line 287: Line 296:
<math>\psi(c) = \left[S \ast K\right](-c)</math>
<math>\psi(c) = \left[S \ast K\right](-c)</math>


==Convolution product for <math>\rho_a(c)</math>==
===Convolution product for <math>\rho_a(c)</math>===
The derivation for <math>\rho_a(c)</math> proceeds similarly. Recall the function is written as follows:
The derivation for <math>\rho_a(c)</math> proceeds similarly. Recall the function is written as follows:


Line 321: Line 330:
Note that the function <math>K^a(c)</math> involves a slight abuse of notation, as it is not literally <math>K(c)</math> taken to the <math>a</math>'th power (as the square of the delta distribution is undefined). Rather, we are simply taking the weights of each delta distribution in the summation to the <math>a</math>'th power.
Note that the function <math>K^a(c)</math> involves a slight abuse of notation, as it is not literally <math>K(c)</math> taken to the <math>a</math>'th power (as the square of the delta distribution is undefined). Rather, we are simply taking the weights of each delta distribution in the summation to the <math>a</math>'th power.


==Round-up==
===Round-up===
Taking all of this, we can rewrite the original expression for Harmonic Renyi Entropy as follows:
Taking all of this, we can rewrite the original expression for Harmonic Renyi Entropy as follows: