Module:Harmonic entropy/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Plumtree (talk | contribs)
mNo edit summary
Sintel (talk | contribs)
No edit summary
Line 1: Line 1:
This module provides several functions to work with [[interval]]-related math.
This module provides several functions to work with [[interval]]-related math. Currently, it only exists to calculate the harmonic entropy.


Namely, the functions in this module can be called from other modules by using <code>require('Module:Interval')</code> and calling the <code>_</code>-prefixed functions.
Namely, the functions in this module can be called from other modules by using <code>require('Module:Interval')</code> and calling the <code>_</code>-prefixed functions.


== Functions ==
== Functions ==
* <code>to_cents(ratio, prec)</code> returns the measure in [[cent]]s of an interval [[ratio]], rounded to a precision of <code>prec</code> decimal places. Parameter <code>prec</code> defaults to 3 if it is omitted.
* <code>harmonic_entropy(c, ratios, deviation, norm)</code> computes [[Harmonic entropy#Basic Model: Shannon Entropy|harmonic Shannon entropy]] of an interval of <code>c</code> [[cent]]s across <code>ratios</code> with a Gaussian with standard <code>deviation</code> (also in [[cent]]s) and a <code>norm</code> associated with the <code>ratios</code>.
* <code>harmonic_entropy(c, ratios, deviation, norm)</code> computes [[Harmonic entropy#Basic Model: Shannon Entropy|harmonic Shannon entropy]] of an interval of <code>c</code> [[cent]]s across <code>ratios</code> with a Gaussian with standard <code>deviation</code> (also in [[cent]]s) and a <code>norm</code> associated with the <code>ratios</code>.


<includeonly><hr><small>Documentation transcluded from [[/doc]]</small> [[Category:Lua modules]]</includeonly>
<includeonly><hr><small>Documentation transcluded from [[/doc]]</small> [[Category:Lua modules]]</includeonly>

Revision as of 20:27, 1 April 2024

This module provides several functions to work with interval-related math. Currently, it only exists to calculate the harmonic entropy.

Namely, the functions in this module can be called from other modules by using require('Module:Interval') and calling the _-prefixed functions.

Functions

  • harmonic_entropy(c, ratios, deviation, norm) computes harmonic Shannon entropy of an interval of c cents across ratios with a Gaussian with standard deviation (also in cents) and a norm associated with the ratios.