back to list

New web page on pseudoinverses and tuning

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/4/2007 6:21:12 PM

I've put this up:

http://www.xenharmony.org/inverses.htm

My hope is that Graham will find it worth referencing, and people in
general useful to know.

🔗Graham Breed <gbreed@gmail.com>

3/5/2007 10:43:41 PM

On 05/03/07, Gene Ward Smith <genewardsmith@coolgoose.com> wrote:
> I've put this up:
>
> http://www.xenharmony.org/inverses.htm
>
> My hope is that Graham will find it worth referencing, and people in
> general useful to know.

I can't reach it. Can you e-mail me a copy?

Graham

🔗Herman Miller <hmiller@IO.COM>

3/5/2007 6:52:35 PM

Gene Ward Smith wrote:
> I've put this up:
> > http://www.xenharmony.org/inverses.htm > > My hope is that Graham will find it worth referencing, and people in > general useful to know.
>

For once I think I understand this. Not that I understand why the pseudoinverse gives the RMS tuning, but that I can follow what's being described without having to pore over it for hours. One small thing that confused me for a bit: where you wrote "A# = (A*A)^(-1) A*", it might be easier to follow if you use the "sup" tag to put the -1 as a superscript instead of using the ^ symbol.

A# = (A*A)<sup>-1</sup> A*

At least (unlike the regular TOP algorithm) it's clear how to generalize this to other kinds of regular temperaments. For an 11-limit rank 2 temperament you just start with a 5x5 matrix with your generators in the top two rows and then the three commas. Even something like an 11-limit rank 3 temperament, tempering out two 11-limit commas, should be possible to optimize this way. At least, assuming you can come up with the untempered generators to begin with. And OpenOffice at least has basic matrix functions (probably Excel does as well, I'd guess).

🔗Herman Miller <hmiller@IO.COM>

3/5/2007 7:29:29 PM

Gene Ward Smith wrote:
> I've put this up:
> > http://www.xenharmony.org/inverses.htm > > My hope is that Graham will find it worth referencing, and people in > general useful to know.

An explanation of how to obtain a unimodular matrix would be useful. By trial and error I found one for lemba:

0 0 -1 1
3 0 0 -1
1 0 2 -2
10 -1 0 -3

But if I use [17, -2, -6, 0> as one of the commas, I get a determinant which isn't �1. The tuning that results seems to be correct, though.

In most cases what I have to start with is either a wedgie:

<<6, -2, -2, -17, -20, 1]]

or a generator mapping:

[<2, 2, 5, 6], <0, 3, -1, -1]>

The generator mapping would be a good place to start, since it matches the first two columns of the inverse matrix.

2 0 1 0
2 3 1 -1
5 -1 3 0
6 -1 3 0

But how can I find values for the second two columns that give reasonable results?

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/6/2007 12:49:32 PM

--- In tuning-math@yahoogroups.com, Herman Miller <hmiller@...> wrote:

> At least (unlike the regular TOP algorithm) it's clear how to
generalize
> this to other kinds of regular temperaments.

I think it makes calculating the tuning dead easy; I don't know why
Graham is insisting otherwise.

> At least, assuming you can come up with
> the untempered generators to begin with.

You don't actually need to come up with any generators. Just use some
primes you want tunings for. For instance, if you wanted 7-limit
miracle do [2,3,225/224,1029/1024]^(-1) and then [5,7,225/224,1029/1024]
^(-1), and take the pseudoinverse of the first two columns. But the
method makes a lot more sense if you use generators, as then you only
do one calculation which gives you the answer you are looking for.

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/6/2007 12:54:30 PM

--- In tuning-math@yahoogroups.com, Herman Miller <hmiller@...> wrote:

> An explanation of how to obtain a unimodular matrix would be
useful.

By finding generators. Now the question is, what is a more efficient
way to do that than brute force?

> In most cases what I have to start with is either a wedgie:
>
> <<6, -2, -2, -17, -20, 1]]
>
> or a generator mapping:
>
> [<2, 2, 5, 6], <0, 3, -1, -1]>
>
> The generator mapping would be a good place to start, since it
matches
> the first two columns of the inverse matrix.

If all you want is the tuning, the generator mapping is all you need.

[<2, 2, 5, 6], <0, 3, -1, -1]># = [|11/367, 37/734, 25/367, 61/734>,
[5/367, 217/734, -22/367, -39/734>] = [601.61635016332111160,
232.61883027989164230].

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/6/2007 2:00:51 PM

--- In tuning-math@yahoogroups.com, Herman Miller <hmiller@...> wrote:

> One small thing that
> confused me for a bit: where you wrote "A# = (A*A)^(-1) A*", it
might be
> easier to follow if you use the "sup" tag to put the -1 as a
superscript
> instead of using the ^ symbol.
>
> A# = (A*A)<sup>-1</sup> A*

This should be better:

http://66.98.148.43/~xenharmo/inverses.htm

> And OpenOffice at least has
> basic matrix functions (probably Excel does as well, I'd guess).

If it has rational arithmetic, one point I made is that floating
point operations are not involved, so that Graham's concerns about
floating point are misplaced. Note also that I gave yet another
general method, which requires solving n equations in n unknowns,
which might be better for someone or other.

🔗Herman Miller <hmiller@IO.COM>

3/6/2007 5:39:46 PM

Gene Ward Smith wrote:

> If all you want is the tuning, the generator mapping is all you need.
> > [<2, 2, 5, 6], <0, 3, -1, -1]># = [|11/367, 37/734, 25/367, 61/734>, > [5/367, 217/734, -22/367, -39/734>] = [601.61635016332111160, > 232.61883027989164230].

Ah, of course. It's pretty obvious now that I reread the page. It takes a while to absorb this stuff...

🔗Graham Breed <gbreed@gmail.com>

3/6/2007 7:29:03 PM

On 06/03/07, Herman Miller <hmiller@io.com> wrote:
> Gene Ward Smith wrote:
> > I've put this up:
> >
> > http://www.xenharmony.org/inverses.htm
> >
> > My hope is that Graham will find it worth referencing, and people in
> > general useful to know.
>
> An explanation of how to obtain a unimodular matrix would be useful. By
> trial and error I found one for lemba:
>
> 0 0 -1 1
> 3 0 0 -1
> 1 0 2 -2
> 10 -1 0 -3
>
> But if I use [17, -2, -6, 0> as one of the commas, I get a determinant
> which isn't ±1. The tuning that results seems to be correct, though.

We've seen unimodular matrices before. They define periodicity
blocks. This is the same problem as finding a torsion-free
periodicity block, maybe with an extra chromatic unison vector (or
whatever you prefer to call them) if you don't enforce octave
equivalence.

Mind you, I thought the point of the pseudoinverse is that you didn't
have to do this.

Graham

🔗Graham Breed <gbreed@gmail.com>

3/7/2007 2:38:41 AM

On 07/03/07, Gene Ward Smith <genewardsmith@coolgoose.com> wrote:
> --- In tuning-math@yahoogroups.com, Herman Miller <hmiller@...> wrote:

> > And OpenOffice at least has
> > basic matrix functions (probably Excel does as well, I'd guess).
>
> If it has rational arithmetic, one point I made is that floating
> point operations are not involved, so that Graham's concerns about
> floating point are misplaced. Note also that I gave yet another
> general method, which requires solving n equations in n unknowns,
> which might be better for someone or other.

How do you plan to deal with the Tenney weighting without floating
point? Anyway, rational arithmetic will probably be less efficient.
There are less efficient but more accurate ways with floating point as
well.

TOP-RMS meantone should be 1201.242 cents octave, 504.026 cents fourth.

*** Citing a pseudoinverse might make equation 27 easier to derive.
This is the one that loses precision but it's the basis for good
special-case rank 2 formulae.

Graham

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/7/2007 10:58:35 AM

--- In tuning-math@yahoogroups.com, "Graham Breed" <gbreed@...> wrote:

> How do you plan to deal with the Tenney weighting without floating
> point?

By working with the exponents, whuch are rational numbers.

> Anyway, rational arithmetic will probably be less efficient.

It doesn't need to be more efficient if it is already very fast, which
it is. And it gives an exact answer.

> There are less efficient but more accurate ways with floating point as
> well.
>
> TOP-RMS meantone should be 1201.242 cents octave, 504.026 cents
fourth.

I'm not getting the same answer for pseudoinverse.

5-limit: 1202.6068229814199824, 505.86546807887252897
7-limit: 1201.3440373095308994, 504.12655010446789025

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/7/2007 4:42:55 PM

--- In tuning-math@yahoogroups.com, "Gene Ward Smith"
<genewardsmith@...> wrote:

> > TOP-RMS meantone should be 1201.242 cents octave, 504.026 cents
> fourth.
>
> I'm not getting the same answer for pseudoinverse.

Your figures are RMS with Tenney weighting, which admittedly makes the
most sense to call TOP-RMS. But before you were calling the
pseudoinverse values that.

🔗Graham Breed <gbreed@gmail.com>

3/7/2007 5:11:48 PM

On 08/03/07, Gene Ward Smith <genewardsmith@coolgoose.com> wrote:
> --- In tuning-math@yahoogroups.com, "Graham Breed" <gbreed@...> wrote:
>
> > How do you plan to deal with the Tenney weighting without floating
> > point?
>
> By working with the exponents, whuch are rational numbers.

How can that work? You never say how and don't give any examples.
You do, however, claim that your unweighted optimization is TOP which
I wish you wouldn't do.

> > Anyway, rational arithmetic will probably be less efficient.
>
> It doesn't need to be more efficient if it is already very fast, which
> it is. And it gives an exact answer.

Well, I want it to be faster. But never mind, as long as you're
happy. Personally, I much prefer correct answers to accurate wrong
answers.

> > There are less efficient but more accurate ways with floating point as
> > well.
> >
> > TOP-RMS meantone should be 1201.242 cents octave, 504.026 cents
> fourth.
>
> I'm not getting the same answer for pseudoinverse.
>
> 5-limit: 1202.6068229814199824, 505.86546807887252897
> 7-limit: 1201.3440373095308994, 504.12655010446789025

These are unweighted optimizations. Where are your TOP figures?

Graham

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/7/2007 5:41:32 PM

--- In tuning-math@yahoogroups.com, "Graham Breed" <gbreed@...> wrote:

> How can that work? You never say how and don't give any examples.
> You do, however, claim that your unweighted optimization is TOP
which
> I wish you wouldn't do.

I was claiming that because you got the exact same figures, so I
assumed those figures were what you wanted and we had a happy
convergence here. It's a little discouraging to find that in fact,
you need to weight to get your new figures, but it has the advantage
of making more sense, I guess.

However, the pseudoinverse method will certainly work with Tenney
weighting, and I need to change my webpage now to say that.

If we take [<1 2 4 7|, <0 -1 -4 -10|], weight, and take the
pseudoinverse, we get [<1 2/p3 4/p5 7/p7|, <0 -1/p3 -4/p5 -10/p7|]# =
[[1, 1.2618595071429148742, 1.7227062322935722026,
2.4934503097561552356], [0, -.63092975357145743708, -
1.7227062322935722026, -3.5620718710802217652]]

The sums of each of the two vectors now gives the TOP-RMS tuning in
terms of octaves.

> Well, I want it to be faster. But never mind, as long as you're
> happy. Personally, I much prefer correct answers to accurate wrong
> answers.

Well, don't freaking blame me. You are the one who misled me by
giving unweighted answers in the first place. I'm shooting a moving
target here.

🔗Graham Breed <gbreed@gmail.com>

3/7/2007 5:40:58 PM

On 08/03/07, Gene Ward Smith <genewardsmith@coolgoose.com> wrote:
> --- In tuning-math@yahoogroups.com, "Gene Ward Smith"
> <genewardsmith@...> wrote:
>
> > > TOP-RMS meantone should be 1201.242 cents octave, 504.026 cents
> > fourth.
> >
> > I'm not getting the same answer for pseudoinverse.
>
> Your figures are RMS with Tenney weighting, which admittedly makes the
> most sense to call TOP-RMS. But before you were calling the
> pseudoinverse values that.

Yes, that's right. Tenney weighting makes a lot of sense with a
Tenney OPtimal tuning. And you certainly can calculate it with a
pseudoinverse.

Graham

🔗Graham Breed <gbreed@gmail.com>

3/7/2007 9:33:39 PM

On 08/03/07, Gene Ward Smith <genewardsmith@coolgoose.com> wrote:
> --- In tuning-math@yahoogroups.com, "Graham Breed" <gbreed@...> wrote:
>
> > How can that work? You never say how and don't give any examples.
> > You do, however, claim that your unweighted optimization is TOP
> which
> > I wish you wouldn't do.
>
> I was claiming that because you got the exact same figures, so I
> assumed those figures were what you wanted and we had a happy
> convergence here. It's a little discouraging to find that in fact,
> you need to weight to get your new figures, but it has the advantage
> of making more sense, I guess.

You're getting confused. My figures haven't changed since last
November, when they agreed with your message of Sat, 11 Nov 2006
22:27:11 -0000. I not only confirmed that the figures matched, but
that the definitions were identical. I'm sorry I didn't notice
earlier that you were giving the wrong calculation this time.

The point, anyway, is that you *do* need floating point calculations
to get the TOP-RMS tuning. You still need them to get the unweighted
optimal RMS error (unless, I suppose, you want the error as a
frequency ratio). It's calculating the error that can be a problem
with floating point precision if you use the wrong formula. So you
could use the more obvious formula. But the main point is that a
linear least squares library should be fast and accurate because this
is the problem it was designed to solve.

There's a peculiar detail about the simpler error formula. For Tenney
weighting, it's identical to the formula for the Tenney-weighted mean
deviation, or somesuch. I thought it was a mistake in my working, but
they really are the same for the TOP tuning. You may find that
interesting. It could well be a known property of least squares
optimizations.

> However, the pseudoinverse method will certainly work with Tenney
> weighting, and I need to change my webpage now to say that.
>
> If we take [<1 2 4 7|, <0 -1 -4 -10|], weight, and take the
> pseudoinverse, we get [<1 2/p3 4/p5 7/p7|, <0 -1/p3 -4/p5 -10/p7|]# =
> [[1, 1.2618595071429148742, 1.7227062322935722026,
> 2.4934503097561552356], [0, -.63092975357145743708, -
> 1.7227062322935722026, -3.5620718710802217652]]
>
> The sums of each of the two vectors now gives the TOP-RMS tuning in
> terms of octaves.

Yes, that looks right.

Graham

🔗Dan Amateur <xamateur_dan@yahoo.ca>

3/7/2007 10:41:38 PM

Saw this recently as a post to a programming forum,
seemed interesting, I realize its a bit off topic, but
wondering if any one had any ideas on how this might
work?

RE: Pendulum motion - SIMULATION HELP Needed
=================================================
Pendulum motion - SIMULATION HELP Needed

Trying to understand how to model the natural
movements of a pendulum in a programming language.

Not sure where to start, I know that certain constants
must be involved but unsure exactly how this would all
work together.

If I apply a certain amount of force with a certain
length of string I should tend to get certain amounts
of arc, swing, circular rotation and duration of
momentum in relation to the original force and
gravity.

So somehow math values such as pi (for circular
motion), a gravitational constant, possible phi or
theta, ranging variables for string length and forces
applied, etc.... must all work together. Perhaps "e"
would be involved somehow as well....?

I'd like the programming routine to be very close to a
real world example, as far as accuracy goes.

In other words if i take a string length of 8 inches,
with say a one ounce weight, and apply a specifc
amount of force, it will swing X times in a linear
fashion, losing Y amount of momentum, at the occurence
of duration XY it will stop swinging in a linear
fashion and begin Clockwise rotation and do so XXY
times, again losing Y amount of momentum and then
after another duration move counter clock wise,
etc.... but...

Id like the software to predict very closely what
would actually happen in the real world scenario.

How would formula being written to solve this
scenario?

Math examples? Code examples?

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/8/2007 12:53:19 PM

--- In tuning-math@yahoogroups.com, "Graham Breed" <gbreed@...> wrote:

> You're getting confused. My figures haven't changed since last
> November, when they agreed with your message of Sat, 11 Nov 2006
> 22:27:11 -0000. I not only confirmed that the figures matched, but
> that the definitions were identical. I'm sorry I didn't notice
> earlier that you were giving the wrong calculation this time.

Arg, sorry. I remembered you as endorsing the unweighted numbers,
which was interesting since they have neat properties.

> The point, anyway, is that you *do* need floating point calculations
> to get the TOP-RMS tuning.

Only at the final stage, though I don't know if there's any use to
that observation. By working over the field Q(p3,p5,p7), which is the
rational numbers with p3=log2(3), p5=log2(5), p7=log2(7) adjoined,
you can compute the pseudoinverse, and get an exact solution in the
form

octave =

2 2 2 2 2 2 2 2
(p5 p7 + 16 p3 p7 + 100 p3 p5 + 16 p3 p7 + 130 p3 p5

2 2 2 2 /
- 4 p5 p7 + 120 p3 p5 - 13 p5 p7 - 48 p3 p7) / (
/

2 2 2 2 2 2 2 2
p5 p7 + 16 p3 p7 + 100 p3 p5 + 16 p7 + 169 p5

2
+ 144 p3 )

fifth =

2 2 2 2
p5 (-p5 p7 + 30 p3 p5 + 39 p3 p5 + 4 p7 + 36 p3 + 13 p5 p7

2 2 2 2 / 2 2
+ p3 p5 p7 + 4 p3 p7 + 10 p7 p3 p5) / (p5 p7
/

2 2 2 2 2 2 2
+ 16 p3 p7 + 100 p3 p5 + 16 p7 + 169 p5 + 144 p3 )

> There's a peculiar detail about the simpler error formula. For
Tenney
> weighting, it's identical to the formula for the Tenney-weighted
mean
> deviation, or somesuch.

Whatever that is. I guess I need to look at the last part of your
paper again.