Tenney–Euclidean metrics: Difference between revisions

No edit summary
Restore the formulae. Move some of the motivation info to the complexity article
Line 2: Line 2:


== TE norm ==
== TE norm ==
The '''Tenney–Euclidean norm''' ('''TE norm''') or '''Tenney–Euclidean complexity''' ('''TE complexity''') applies to [[val]]s (equal temperaments) as well as to [[monzo]]s (intervals).  
The '''Tenney–Euclidean norm''' ('''TE norm''') or '''Tenney–Euclidean complexity''' ('''TE complexity''') applies to [[val]]s as well as to [[monzo]]s, and provides the complexity for either of them.  


=== Val complexity ===
Let us define the val weighting matrix ''W'' to be the {{w|diagonal matrix}} with values 1, 1/log<sub>2</sub>3, 1/log<sub>2</sub>5 … 1/log<sub>2</sub>''p'' along the diagonal. For the [[harmonic limit|''p''-limit]] prime basis ''Q'' = {{val| 2 3 5 … ''p'' }},  
When applied to vals, it provides the complexity of the val (roughly, the "number of notes" in the tuning system). A naive approach might be to simply take the mapping of 2, but for unusual mappings where 2 is mapped to a strange number of steps, that doesn't work. TE complexity is foolproof and equave-agnostic, however. The TE complexity of 31-ET is 30.98, which is close to the edo number as expected for a patent val. But if one were to take the TE complexity of [1 1900 2785 3370], which is technically a tuning of 1-ET, you get 1038.83, which matches the complexity of the tuning much better than the naive approach of simply taking 1 for the complexity, and means that that val is roughly equivalent to 1039edo in complexity.


To find the Tenney-Euclidean norm of a val, you divide each of its entries by the logarithm (base 2) of the prime that it corresponds to, then treat the resulting vector as a point in Euclidean space. The norm is the distance from the origin to that point, scaled by the square root of the dimensionality of the space. For example, for 31-ET, you get [31, 49/log<sub>2</sub>3, 72/log<sub>2</sub>5, 87/log<sub>2</sub>7], or roughly [31, 30.92, 31.01, 30.99]. Each of these entries individually tells you how "sharp" or "flat" each tuning is relative to the octave. The distance from the origin to this point is ~61.96, which is divided by sqrt(4)=2 to receive the norm, 30.98.
$$ W = \operatorname {diag} (1/\log_2 (Q)) $$


Formally, the scaling factors may be represented by a "val weighting matrix" W, a {{w|diagonal matrix}} with values 1, 1/log<sub>2</sub>3, 1/log<sub>2</sub>5 … 1/log<sub>2</sub>''p'' along the diagonal for the [[harmonic limit|''p''-limit]] prime basis ''Q'' = {{val| 2 3 5 … ''p'' }}, or the analog in any subgroup.  
Right-multiplying a row vector by this matrix scales each entry by the corresponding entry of the diagonal matrix.  


=== Monzo complexity ===
Given a val ''V'' expressed as a row vector, the corresponding row vector in weighted coordinates is {{nowrap| ''V''<sub>''W''</sub> {{=}} ''VW'' }} with transpose {{nowrap| {{subsup|''V''|''W''|T}} {{=}} ''WV''{{t}} }} where {{t}} denotes the transpose. The {{w|dot product}} of a weighted val with itself, or the sum of the squares of its entries, is the squared Euclidean metric of the val, {{nowrap| {{subsup|‖''V''<sub>''W''</sub>‖|2|2}} {{=}} ''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}} {{=}} ''VW''<sup>2</sup>''V''{{t}} }}. Thus the Euclidean metric on the val, a measure of complexity, is {{nowrap| ‖''V''<sub>''W''</sub>‖<sub>2</sub> {{=}} sqrt(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}) }} {{nowrap| {{=}} sqrt({{subsup|''v''|1|2}} + {{subsup|''v''|2|2}}/(log<sub>2</sub>3)<sup>2</sup> + … + {{subsup|''v''|''n''|2}}/(log<sub>2</sub>''p'')<sup>2</sup>) }}, where {{nowrap|''n'' {{=}} π(''p'')}} is the {{w|prime-counting function}} which records the number of primes to ''p''; dividing this by sqrt(''n'') gives the TE norm of a val.
When applied to monzos, it provides a measure of complexity for the interval itself. To calculate the monzo weighting matrix, you use a similar method, but instead of dividing by the logarithm of each prime, you multiply. This can be thought of as scaling the lattice of intervals so that larger primes represent greater distances along their respective axes. Again, this results in a vector that can be treated as a point in Euclidean space. Then, as with vals, the TE norm is the distance from the origin to that point, but this time it is multiplied by the square root of the dimensionality rather than divided. That means the TE complexity of, say, 5/3, is the distance from the origin to [0 -1.585 2.322], the scaled version of the monzo [0 -1 1], multiplied by sqrt(3). That value is 2.939.  
 
Geometrically, this means you divide each of the val's entries by the logarithm base 2 of the prime that it corresponds to, then treat the resulting vector as a point in Euclidean space. The norm is the distance from the origin to that point, scaled by the square root of the dimensionality of the space.
 
For example, for 31et, you get {{val| 31 49/log<sub>2</sub>3 72/log<sub>2</sub>5 87/log<sub>2</sub>7 }}, or roughly {{val| 31 30.92 31.01 30.99 }}. Each of these entries individually tells you how sharp or flat each tuning is relative to the octave. The distance from the origin to this point is ~61.96, which is divided by {{nowrap| sqrt(4) {{=}} 2 }} to receive the norm, 30.98.
 
Similarly, if '''m''' is a monzo, then in weighted coordinates the monzo becomes {{nowrap| '''m'''<sub>''W''</sub> {{=}} ''W''{{inv}}'''m''' }}, and the dot product is {{nowrap| {{subsup|'''m'''|''W''|T}}'''m'''<sub>''W''</sub> {{=}} '''m'''{{t}}''W''<sup>-2</sup>'''m''' }}, leading to {{nowrap| sqrt({{subsup|'''m'''|''W''|T}}'''m'''<sub>''W''</sub>) {{=}} sqrt({{subsup|''m''|1|2}} + (log<sub>2</sub>3)<sup>2</sup>{{subsup|''m''|2|2}} + … + (log<sub>2</sub>''p'')<sup>2</sup>{{subsup|''m''|''n''|2}}) }}; multiplying this by sqrt(''n'') gives the dual RMS norm on monzos which serves as a measure of complexity.
 
This is a similar method, but instead of dividing by the logarithm of each prime, you multiply, which can be thought of as scaling the lattice of intervals so that larger primes represent greater distances along their respective axes. Again, this results in a vector that can be treated as a point in Euclidean space. Then, as with vals, the TE norm is the distance from the origin to that point, but this time it is multiplied by the square root of the dimensionality rather than divided.  
 
For example, the TE complexity of 5/3 is the distance from the origin to {{monzo| 0 -1.585 2.322 }}, the scaled version of the monzo {{monzo| 0 -1 1 }}, multiplied by sqrt(3). That value is 2.939.  


== TE temperamental norm ==
== TE temperamental norm ==
{{Todo|Rewrite|inline=1|text=Pretty sure a lot of this is just sorta assuming we don't already have the generator tuning map.}}
{{Todo|Rewrite|inline=1|text=Pretty sure a lot of this is just sorta assuming we don't already have the generator tuning map.}}
Suppose now ''V'' is a matrix whose rows are vals defining a ''p''-limit regular temperament. Then the corresponding weighted matrix is {{nowrap|''V''<sub>''W''</sub> {{=}} ''VW''}}. The [[Tenney–Euclidean tuning|TE tuning]] [[projection matrix]] is then {{nowrap|''P''<sub>''W''</sub> {{=}} {{subsup|''V''|''W''|+}}''V''<sub>''W''</sub>}}, where {{+}} denotes the {{w|Moore–Penrose pseudoinverse}}. If the rows of ''V<sub>W</sub>'' (or equivalently, ''V'') are linearly independent, then we have {{nowrap|{{subsup|''V''|''W''|+}} {{=}} {{subsup|''V''|''W''|T}}(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}}}}. In terms of vals, the tuning projection matrix is {{nowrap|{{subsup|''V''|''W''|+}}''V''<sub>''W''</sub> {{=}} {{subsup|''V''|''W''|T}}(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}}''V''<sub>''W''</sub>}} {{nowrap|{{=}} ''WV''{{t}}(''VW''<sup>2</sup>''V''{{t}}){{inv}}''VW''}}. ''P<sub>W</sub>'' is a {{w|positive-definite matrix|positive semidefinite matrix}}, so it defines a {{w|definite bilinear form|positive semidefinite bilinear form}}. In terms of weighted monzos ('''m'''<sub>''W''</sub>)<sub>1</sub> and ('''m'''<sub>''W''</sub>)<sub>2</sub>, {{subsup|('''m'''<sub>''W''</sub>)|1|T}}''P<sub>W</sub>''('''m'''<sub>''W''</sub>)<sub>2</sub> defines the semidefinite form on weighted monzos, and hence {{subsup|'''m'''|1|T}}''W''{{inv}}''P<sub>W</sub>W''{{inv}}'''m'''<sub>2</sub> defines a semidefinite form on unweighted monzos, in terms of the matrix {{nowrap|''P'' {{=}} ''W''{{inv}}''P''<sub>''W''</sub>''W''{{inv}}}} {{nowrap|{{=}} ''V''{{t}}(''VW''<sup>2</sup>''V''{{t}}){{inv}}''V''}}. From the semidefinite form we obtain an associated {{w|definite quadratic form|semidefinite quadratic form}} '''m'''{{t}}''P'''''m''' and from this the {{w|norm (mathematics)|seminorm}} sqrt('''m'''{{t}}''P'''''m''').
 
Suppose now ''V'' is a matrix whose rows are vals defining a ''p''-limit regular temperament. Then the corresponding weighted matrix is {{nowrap| ''V''<sub>''W''</sub> {{=}} ''VW'' }}. The [[Tenney–Euclidean tuning|TE tuning]] [[projection matrix]] is then {{nowrap| ''P''<sub>''W''</sub> {{=}} {{subsup|''V''|''W''|+}}''V''<sub>''W''</sub> }}, where {{+}} denotes the {{w|Moore–Penrose pseudoinverse}}. If the rows of ''V''<sub>''W''</sub> (or equivalently, ''V'') are linearly independent, then we have {{nowrap| {{subsup|''V''|''W''|+}} {{=}} {{subsup|''V''|''W''|T}}(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}} }}. In terms of vals, the tuning projection matrix is {{nowrap| {{subsup|''V''|''W''|+}}''V''<sub>''W''</sub> {{=}} {{subsup|''V''|''W''|T}}(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}}''V''<sub>''W''</sub> }} {{nowrap| {{=}} ''WV''{{t}}(''VW''<sup>2</sup>''V''{{t}}){{inv}}''VW'' }}. ''P''<sub>''W''</sub> is a {{w|positive-definite matrix|positive semidefinite matrix}}, so it defines a {{w|definite bilinear form|positive semidefinite bilinear form}}. In terms of weighted monzos ('''m'''<sub>''W''</sub>)<sub>1</sub> and ('''m'''<sub>''W''</sub>)<sub>2</sub>, {{subsup|('''m'''<sub>''W''</sub>)|1|T}}''P''<sub>''W''</sub>('''m'''<sub>''W''</sub>)<sub>2</sub> defines the semidefinite form on weighted monzos, and hence {{subsup|'''m'''|1|T}}''W''{{inv}}''P''<sub>''W''</sub>''W''{{inv}}'''m'''<sub>2</sub> defines a semidefinite form on unweighted monzos, in terms of the matrix {{nowrap| ''P'' {{=}} ''W''{{inv}}''P''<sub>''W''</sub>''W''{{inv}} }} {{nowrap| {{=}} ''V''{{t}}(''VW''<sup>2</sup>''V''{{t}}){{inv}}''V''}}. From the semidefinite form we obtain an associated {{w|definite quadratic form|semidefinite quadratic form}} '''m'''{{t}}''P'''''m''' and from this the {{w|norm (mathematics)|seminorm}} sqrt('''m'''{{t}}''P'''''m''').


It may be noted that {{nowrap|(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}} {{=}} (''VW''<sup>2</sup>''V''{{t}}){{inv}}}} is the inverse of the {{w|Gramian matrix}} used to compute [[TE complexity]], and hence is the corresponding Gram matrix for the dual space. Hence ''P'' represents a change of basis defined by the mapping given by the vals combined with an {{w|inner product space|inner product}} on the result. Given a monzo '''m''', ''V'''''m''' represents the tempered interval corresponding to '''m''' in a basis defined by the mapping ''V'', and {{nowrap|''P''<sub>''T''</sub> {{=}} (''VW''<sup>2</sup>''V''{{t}}){{inv}}}} defines a positive-definite quadratic form, and hence a norm, on the tempered interval space with basis defined by ''V''.
It may be noted that {{nowrap|(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}} {{=}} (''VW''<sup>2</sup>''V''{{t}}){{inv}}}} is the inverse of the {{w|Gramian matrix}} used to compute [[TE complexity]], and hence is the corresponding Gram matrix for the dual space. Hence ''P'' represents a change of basis defined by the mapping given by the vals combined with an {{w|inner product space|inner product}} on the result. Given a monzo '''m''', ''V'''''m''' represents the tempered interval corresponding to '''m''' in a basis defined by the mapping ''V'', and {{nowrap|''P''<sub>''T''</sub> {{=}} (''VW''<sup>2</sup>''V''{{t}}){{inv}}}} defines a positive-definite quadratic form, and hence a norm, on the tempered interval space with basis defined by ''V''.


Denoting the temperament-defined, or temperamental, seminorm by ''T''(''x''), the subspace of interval space such that {{nowrap|''T''(''x'') {{=}} 0}} contains a lattice consisting of the commas of the temperament, which is a sublattice of the lattice of monzos. The {{w|quotient space (linear algebra)|quotient space}} of the full vector space by the commatic subspace such that {{nowrap|''T''(''x'') {{=}} 0}} is now a {{w|normed vector space}} with norm given by ''T'', in which the intervals of the regular temperament define a lattice. The norm ''T'' on these lattice points is the '''TE temperamental norm''' or '''TE temperamental complexity''' of the intervals of the regular temperament; in terms of the basis defined by ''V'', it is sqrt('''t'''{{t}}''P<sub>T</sub>'''''t''') where '''t''' is the image of a monzo '''m''' by {{nowrap|'''t''' {{=}} ''V'''''m'''}}.
Denoting the temperament-defined, or temperamental, seminorm by ''T''(''x''), the subspace of interval space such that {{nowrap|''T''(''x'') {{=}} 0}} contains a lattice consisting of the commas of the temperament, which is a sublattice of the lattice of monzos. The {{w|quotient space (linear algebra)|quotient space}} of the full vector space by the commatic subspace such that {{nowrap|''T''(''x'') {{=}} 0}} is now a {{w|normed vector space}} with norm given by ''T'', in which the intervals of the regular temperament define a lattice. The norm ''T'' on these lattice points is the '''TE temperamental norm''' or '''TE temperamental complexity''' of the intervals of the regular temperament; in terms of the basis defined by ''V'', it is sqrt('''t'''{{t}}''P''<sub>''T''</sub>'''t''') where '''t''' is the image of a monzo '''m''' by {{nowrap| '''t''' {{=}} ''V'''''m''' }}.


== Octave-equivalent TE seminorm ==
== Octave-equivalent TE seminorm ==