[music-dsp] Re: similar

Sergio R. Caprile scaprile at yahoo.com
Thu Jan 18 09:05:21 EST 2001

```>I've got two waves which are quite alike.
[...]
>Now I want a number describing how 'good' my simulation is.
[...]
>Or, are there other methods besides the x-corr, perhaps?

Well, there are some "goodness of fit" tests in statistics, unfortunately
(fortunately for many of you ;^), I don't remember the maths. Check a good
statistics text, as "Probability and statistics" by Papoulis.

Now to the real world:
You can try plotting an error curve, where e=f(x)-g(x), f(x) is the "real"
and g(x) is your model. Many graphics packages do this (gnuplot, ACE/gr). I
guess a least squares method is better.

This is by far the same problem that arises when trying to match a sample to
a pattern on pattern recognition, so any method will suit. Try plotting the
distance between points [f(x) is the pattern point and g(x) the sample
point], this is the radius of a circumference centered in f(x) and passing
through g(x). If pattern and sample don't have an equal number of points,
you'll have to resample one of them or apply a time warping algorithm.
Analog Devices provides one on its ftp server, it is assembler for the 21xx
family, although. In pattern matching, the circle center is the mean and the
radius the standard deviation, of many samples of the pattern (the "real");
good points fall inside the circle. You can just plot the different radiuses
as a measure of fit.

As for we are talking about two curves, I bet a correlation analysis will be
better; but don't think of the correlation on what you know from signals and
systems, go for a statistical correlation. (Again), I don't recall the maths
correlation to see if one fits the other.

I've found something on the net about using ellipses instead of circles, but
the ellipse is formed by having many samples of the pattern (you'll have to
take many measures of the "real", and then measure the distance from the
model. Again, good points will fit inside the ellipse.
I used this last method on a pattern matching software (sound recognition),
but I don't remember the name. I can look it up on a paper I have at home,
if there is anyone interested.

The advantage of seeing the problem as a pattern matching is that you can
tweek the model to fit inside a range, instead of trying to get a zer error
to just one (and probably not so good) measure.

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/

```