Module:Infobox ET: Difference between revisions
No edit summary |
No edit summary |
||
| Line 240: | Line 240: | ||
if et.size <= 70 and et.size > 4 then | if et.size <= 70 and et.size > 4 then | ||
local delta_harmonic_entropy = | local delta_harmonic_entropy = 1000 | ||
for i=1, math.floor(et.size)-2 do | for i=1, math.floor(et.size)-2 do | ||
for j=1, i-1 do | for j=1, i-1 do | ||
local delta = (math.pow(2, i * step_size / 1200) - math.pow(2, j * step_size / 1200)) / (math.pow(2, j * step_size / 1200) - 1) | local delta = (math.pow(2, i * step_size / 1200) - math.pow(2, j * step_size / 1200)) / (math.pow(2, j * step_size / 1200) - 1) | ||
local he = interval_extension.harmonic_entropy_with_lookup_table(rat.cents(delta)) | local he = interval_extension.harmonic_entropy_with_lookup_table(rat.cents(delta)) | ||
delta_harmonic_entropy = | if he <= delta_harmonic_entropy then delta_harmonic_entropy = he end | ||
end | end | ||
end | end | ||
delta_harmonic_entropy = delta_harmonic_entropy / l | delta_harmonic_entropy = delta_harmonic_entropy / l | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"[[Delta | "Min of [[Delta]]-HE", | ||
"~" .. utils._round(delta_harmonic_entropy, 6) .. " nats" | "~" .. utils._round(delta_harmonic_entropy, 6) .. " nats" | ||
}) | }) | ||