I have this two wavs. Same audible audio differente data.

The audios are phone operator messages, so they are always the same.

enter image description here Wav:http://instaud.io/3Ezu

enter image description here Wav:http://instaud.io/3Ezw

Using this formula I found here i get how similar they are:


    double[] Data1 = GetMyWav1InDoubles();
    double[] Data2 = GetMyWav2InDoubles();
    double Mx = Data1.Average();
    double My = Data2.Average();

    double Denominator1 = Math.Sqrt(Data1.Sum(x => (x - Mx) * (x - Mx)));
    double Denominator2 = Math.Sqrt(Data2.Sum(y => (y - My) * (y - My)));
    double MaximumNormalizedCrossCorrelation = maxValue / (Denominator1 * Denominator2);

The MaximumNormalizedCrossCorrelation value es 56% similar which is low, considering they sound the same...

I have read I must do FFT and then compare! but I'm lost, I'm using:


After getting the real part of the result I got this graphs

enter image description here enter image description here

So, how can i get a similarity percentage?

I read this: enter image description here src: https://lstsal.wordpress.com/2015/02/28/comparing-two-audio-files/

but how?

  • $\begingroup$ no, the cross-correlation should give you a good result. there is a method of computing cross-correlation using the FFT that should save you instruction cycles. i am surprized it is as low as 0.56. are you sure that the durations are the same? could it be possible that one was "stretched" a little in time relative to the other? $\endgroup$ – robert bristow-johnson May 8 '19 at 23:18
  • $\begingroup$ where is maxValue defined in your code? and x and y? $\endgroup$ – robert bristow-johnson May 8 '19 at 23:20
  • $\begingroup$ maxvalue is the highest double in both series, and x and y is the variable of the lambda! thats c# code. (x=> x * 1) x is the value of the item inside de array $\endgroup$ – Fraga May 8 '19 at 23:42
  • $\begingroup$ where/how is your cross-correlation computed? $\endgroup$ – robert bristow-johnson May 8 '19 at 23:44
  • $\begingroup$ alglib.net/translator/man/manual.csharp.html#sub_corrr1d $\endgroup$ – Fraga May 8 '19 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.