7

I want to start a big project and it is required to compare two audio files to get % of match.

Example :

  1. audio A is the original audio.

  2. audo B is recorded from microphone. ( everything is same as in audio A, except for voice )

  3. I want to know how close B is to A in percents. ( 100% = identical )

Does anyone know a way how to do this?

Maybe it could be possible by comparing spectrum of file A with the spectrum of file B..

John
  • 7,500
  • 16
  • 62
  • 95
  • 1
    It all depends on what do you mean by "comparing two audio files". 100% is easy to imagine but how about 0%?. As you can see, the definition of "comparison of audio files" is not well defined so your solution will be not define as well. Should the comparison be computed on a perception point of view (sounds which resemble the same on both audio files) or should it be based on a mere byte-byte arithmetic difference? – Gianluca Ghettini Jan 02 '13 at 08:01
  • You might write a book on sound processing and comparison, so voted to close as 'overly broad'. – Andrew Thompson Jan 02 '13 at 08:01
  • What does compare mean for you? You have to check the vocal and the instrumental. May this helps? http://stackoverflow.com/questions/3673042/algorithm-to-remove-vocal-from-sound-track – SomeJavaGuy Jan 02 '13 at 08:02
  • 1
    You have posted this question with four programming language tags. Pick *one* and you might actually be able to get some useful help. I can preemptively say that PHP has virtually no audio processing libraries, so you should look elsewhere. – Charles Jan 02 '13 at 08:26
  • hey did you ever end up figuring this out? looking for the same thing – stackPusher Sep 21 '17 at 22:26

1 Answers1

2

I have done this sort of thing in my undergrad course project but with image files. The thing you would want to look into is Cross-correlation. In which you can measure similarities between two signals. Also you might want to preprocess the audio files ie: normalize, apply some low pass filter to remove noise.

I would suggest Digital Signal Processing by Oppenheim to get a deep understanding of signal processing.

But again these techniques are quite vague, until yopu know what type of similarities you want to find.

Aamir Abro
  • 838
  • 12
  • 24
  • To follow up on image comparing, there is a company (LTU) that has an application for comparing images based on a vector and then the vectors are compared, this reflects the difference between 2 images. This is not a byte/byte comparison, it matches cropped and inverted images. Maybe their technique can be adapted to audio files. That said, I doubt you can get your hand on their algo. – Nick.T Jan 02 '13 at 08:37
  • @Nick.T But, I think there has to be some open source projects to do these things. – Aamir Abro Jan 02 '13 at 08:57
  • I only know of it because a client said to me "I want LTU". So no research of opensource projects for me. I do agree that this type of algo must exist in an opensource project. Maybe the question could be rephrased and asked in the `mathematica` stack... – Nick.T Jan 02 '13 at 09:08
  • Yes and also like as @charles said, the question should be with tag like matlab. – Aamir Abro Jan 02 '13 at 09:24