back to list

Algorithm to construct Thomae's function to any arbitrary accuracy?

🔗Mike Battaglia <battaglia01@gmail.com>

1/14/2011 8:51:55 PM

Thomae's function is mathematically related to harmonic entropy:

http://en.wikipedia.org/wiki/Thomae%27s_function

It is starting to look like the "DC" method I had come up with a while
ago, as well as Paul's HE method, turn out to converge to the same
function as the limit of the bound on n*d goes to infinity.
Specifically, both of the basis functions turn into something similar
to this, and by convolving them with a Gaussian and flipping
everything upside down you get the HE curve.

That is, when the limit of the bound on n*d is LESS than infinity,
some error is introduced into the model; DC and HE distribute this
error differently. If there's a really fast algorithm to generate
Thomae's function, then there'd be a third way to calculate the HE
curve, and one that might be more accurate and faster to compute
(Tenney series generation seems to be painfully slow).

Thomae's function is related to the Dirichlet rational indicator
function, which can be found here:
http://en.wikipedia.org/wiki/Dirichlet_function

There's an algorithm to generate this function involving taking the
double point-wise limit of a cosine. Perhaps this could be adopted to
the other function as well?

-Mike

🔗genewardsmith <genewardsmith@sbcglobal.net>

1/15/2011 7:51:29 PM

--- In tuning-math@yahoogroups.com, Mike Battaglia <battaglia01@...> wrote:

> If there's a really fast algorithm to generate
> Thomae's function, then there'd be a third way to calculate the HE
> curve, and one that might be more accurate and faster to compute
> (Tenney series generation seems to be painfully slow).

I'd very much like to see a fast way of computing anything related to HE. I was trying to see if the Minkowski ? function would help, but I didn't get very good results. Maybe you could do better.

🔗Mike Battaglia <battaglia01@gmail.com>

1/15/2011 11:40:51 PM

On Sat, Jan 15, 2011 at 10:51 PM, genewardsmith
<genewardsmith@sbcglobal.net> wrote:
>
> --- In tuning-math@yahoogroups.com, Mike Battaglia <battaglia01@...> wrote:
>
> > If there's a really fast algorithm to generate
> > Thomae's function, then there'd be a third way to calculate the HE
> > curve, and one that might be more accurate and faster to compute
> > (Tenney series generation seems to be painfully slow).
>
> I'd very much like to see a fast way of computing anything related to HE. I was trying to see if the Minkowski ? function would help, but I didn't get very good results. Maybe you could do better.

This seems like a brilliant idea, I never thought of that! So I notice
this, from wikipedia:

"The question mark function is a strictly increasing and continuous,
but not absolutely continuous function. The derivative vanishes on the
rational numbers. There are several constructions for a measure that,
when integrated, yields the question mark function. One such
construction is obtained by measuring the density of the Farey numbers
on the real number line. The question mark measure is the prototypical
example of what are sometimes referred to as multi-fractal measures."

The density of the Farey numbers on the real number line are obviously
related to HE. How can this be constructed? I think the derivative of
this function will look something like HE, but where the rationals all
touch 0.

Check the other thread I posted though - the HE convolution algorithm
I posted is faster in many respects. Note here:
http://www.mikebattagliamusic.com/music/HEConvolutionTheorem.html

The current bottleneck is the creation of the kernel to be convolved
with a Gaussian. Note this picture:

http://www.mikebattagliamusic.com/music/HEkernel.png

This is HE's basis function - by convolving this with an upside-down
Gaussian you get HE exactly. This is the "DC" model I had posted a
while ago:

http://www.mikebattagliamusic.com/music/DCkernel.png

I have promised some kind of huge computational speedup for HE and it
will come once I can determine what happens to the HE kernel as the
limit on n*d becomes infinite.

-Mike

🔗genewardsmith <genewardsmith@sbcglobal.net>

1/16/2011 3:50:30 PM

--- In tuning-math@yahoogroups.com, Mike Battaglia <battaglia01@...> wrote:

> The density of the Farey numbers on the real number line are obviously
> related to HE. How can this be constructed?

The derivative of ?(x), or rather the related measure, is what I was trying to use. I put some code on the bottom of this page some while back:

http://xenharmonic.wikispaces.com/MOSScales

Probably you can improve on it. One day you should also write a Xenwiki article on computing HE.

🔗Mike Battaglia <battaglia01@gmail.com>

1/17/2011 7:45:48 PM

On Sun, Jan 16, 2011 at 6:50 PM, genewardsmith
<genewardsmith@sbcglobal.net> wrote:
>
> --- In tuning-math@yahoogroups.com, Mike Battaglia <battaglia01@...> wrote:
>
> > The density of the Farey numbers on the real number line are obviously
> > related to HE. How can this be constructed?
>
> The derivative of ?(x), or rather the related measure, is what I was trying to use. I put some code on the bottom of this page some while back:
>
> http://xenharmonic.wikispaces.com/MOSScales
>
> Probably you can improve on it. One day you should also write a Xenwiki article on computing HE.

I wish I had maple - only MATLAB. I'll do that at some point, swamped
with work right now though.

-Mike