DSPRelated.com
Forums

Calculate % of similarity between two samples

Started by Jorge June 12, 2007
Hello,

I'm trying to find an application that allows me to... input two
samples (in mp3, wav, anything!), and calculates the % of
similarity... does anybody here knows of a software capable of doing
this ? (or about an algorithm for this purpose...)

Thank you !

On Jun 12, 8:25 pm, Jorge <jleandrope...@gmail.com> wrote:
> Hello, > > I'm trying to find an application that allows me to... input two > samples (in mp3, wav, anything!), and calculates the % of > similarity... does anybody here knows of a software capable of doing > this ? (or about an algorithm for this purpose...) > > Thank you !
Let's start by defining "similarity", then we can talk about how to actually measure it. So what do you mean by "similarity"? Julius
I'm working on a final project, and i'm doing a guitar distortion with
neural networks.

The main issue i have is... how to prove it actually works fine, not
just by ear. So... my idea is... having the following audio
samples...:


Guitar Clean Sample A    >>   Real effect  >> Distorted Guitar sound
A'

Guitar Clean Sample A    >>   Neural network Effect  >> Distorted
Guitar sound A''


I'd like to test A'  against A''  (expected sound -real effect-
against real sound -neural network-)... and use some kind of metric to
evaluate actually how accurate my project is working.

Both A' and A'' should have the exact time length... so... i guess...
similarity in this case would be defined as the percentaje of DB equal
in both A' and A''... unless you have a suggestion.

Thank you VERY much!!!!

Jorge wrote:
> Hello, > > I'm trying to find an application that allows me to... input two > samples (in mp3, wav, anything!), and calculates the % of > similarity... does anybody here knows of a software capable of doing > this ? (or about an algorithm for this purpose...)
I'm sure I can devise a method for measuring similarity if you define exactly what it means. In what way are two pieces "obviously" by the same composer similar? Are two renditions of the same song, one by Ella Fitzgerald and the other by Bing Crosby similar? What about transposing? Get all the specs down and the rest will be easy. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
On Jun 12, 8:25 pm, Jorge <jleandrope...@gmail.com> wrote:
> I'm working on a final project, and i'm doing a guitar distortion with > neural networks. > > The main issue i have is... how to prove it actually works fine, not > just by ear. So... my idea is... having the following audio > samples...: > > Guitar Clean Sample A >> Real effect >> Distorted Guitar sound > A' > > Guitar Clean Sample A >> Neural network Effect >> Distorted > Guitar sound A'' > > I'd like to test A' against A'' (expected sound -real effect- > against real sound -neural network-)... and use some kind of metric to > evaluate actually how accurate my project is working. > > Both A' and A'' should have the exact time length... so... i guess... > similarity in this case would be defined as the percentaje of DB equal > in both A' and A''... unless you have a suggestion.
Sounds like you need some sort of human perceptual model. e.g. waveforms A' and A'' might look completely different, but sound identical to 90+% of the all humans. I would be tempted to run both waveforms through an mp3 medium bit-rate compressor/player, to remove most of the inaudible differences, plot a spectrogram of both resulting waveforms, and then do a photo diff, or something like that. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Ron, i REALLY like your approach.!!!.

Jerry, i know you already know this for sure, but i'm writing it down
just to ease things down. Distortion introduces harmonics of the
original signal, resulting in a different waveform... more 'squared'-
like.

If i have both signal A as input, and A' and A'' as output of two
different systems, and i want to measure how different they really are
(A' against A'') in waveform terms... i guess the easiest way to do
this is by measuring the distance between A'' and A' for every single
point.

If the average distance is 0, then it's 100% equal. The problem is...
how to define the lower boundary... when a signal is 0% equal to
another?.

Thanks for your help... i really appreciate it =D

Jorge wrote:
> Ron, i REALLY like your approach.!!!. > > Jerry, i know you already know this for sure, but i'm writing it down > just to ease things down. Distortion introduces harmonics of the > original signal, resulting in a different waveform... more 'squared'- > like. > > If i have both signal A as input, and A' and A'' as output of two > different systems, and i want to measure how different they really are > (A' against A'') in waveform terms... i guess the easiest way to do > this is by measuring the distance between A'' and A' for every single > point.
That fails completely in the presence of phase shift.
> If the average distance is 0, then it's 100% equal. The problem is... > how to define the lower boundary... when a signal is 0% equal to > another?. > > Thanks for your help... i really appreciate it =D
I have a better idea now of what you want to do and why. The signals you want to compare are inherently similar, being a differently distorted versions of some original. Why not measure and characterize the distortions? Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
>Jorge wrote: >> Ron, i REALLY like your approach.!!!. >> >> Jerry, i know you already know this for sure, but i'm writing it down >> just to ease things down. Distortion introduces harmonics of the >> original signal, resulting in a different waveform... more 'squared'- >> like. >> >> If i have both signal A as input, and A' and A'' as output of two >> different systems, and i want to measure how different they really are >> (A' against A'') in waveform terms... i guess the easiest way to do >> this is by measuring the distance between A'' and A' for every single >> point. > >That fails completely in the presence of phase shift. > >> If the average distance is 0, then it's 100% equal. The problem is... >> how to define the lower boundary... when a signal is 0% equal to >> another?. >> >> Thanks for your help... i really appreciate it =D > >I have a better idea now of what you want to do and why. The signals you
>want to compare are inherently similar, being a differently distorted >versions of some original. Why not measure and characterize the
distortions?
> >Jerry >-- >Engineering is the art of making what you want from things you can get.
Since distortion is a deviation from ideal signal, that means we should know the original signal inorder to evaluate the distortion for both signals waveforms.But if one wants to have this measure without having any knowledge about original signal,other measures will be required.
> I have a better idea now of what you want to do and why. The signals you > want to compare are inherently similar, being a differently distorted > versions of some original. Why not measure and characterize the distortions?
Jerry, i'm a complete ignorant about measure and characterization of distortions... could you please tell me where can i read about this?. Is there any written software for this purpose ?. Sylvia, i'll have both, original signal, distorted signal A, and distorted signal B (both distorted signals come from the same original one). I'd like to compare A against B, and be able to say up to what extent A and B are similar (in order to proof my work). Thank you both!!
On Wed, 13 Jun 2007 09:31:11 -0700, Jorge <jleandroperez@gmail.com>
wrote:

>> I have a better idea now of what you want to do and why. The signals you >> want to compare are inherently similar, being a differently distorted >> versions of some original. Why not measure and characterize the distortions? > >Jerry, i'm a complete ignorant about measure and characterization of >distortions... could you please tell me where can i read about this?. >Is there any written software for this purpose ?. > >Sylvia, i'll have both, original signal, distorted signal A, and >distorted signal B (both distorted signals come from the same >original one). I'd like to compare A against B, and be able to say up >to what extent A and B are similar (in order to proof my work). > >Thank you both!!
Is this not just a general cross-correlation problem? A cross-correlation between the two provides a measure of how correlated (aka, similar) the two signals may be. The process is independent of phase shift, etc., when one finds the peak. Eric Jacobsen Minister of Algorithms Abineau Communications http://www.ericjacobsen.org