I have a set of audio files which contain a word each one, and I'd want to be able to compare a new word (coming from a smartphone mic) to check if it resembles to a specific file and how much it resembles to that audio file. I don't need to know which word it is, or doing a STT system, actually, just checking how similar two words are. The words may come from different speakers, male, female, old people, kids, even non-speakers for a specific language.

Now, the question is, which should be the processes to do something quite simple? I've been reading about MFCC, DTW and I can ensure I understand little to nothing about how I should proceed. I'd need to create an algorithm to match those words, but I have not a single clue on how to proceed after the "Conception steps".

I have, however, tried an Android library called Musicg, which should compare sounds based on:

  • A frequency range for the whole sound
  • An intensity range for the whole sound
  • A standard deviation range (yes, for the whole sound)
  • A High pass and low pass limits
  • Range of times the sound crosses the "zero" line

But I am pretty sure this might not be enough to make sure two sounds are similar or different. The examples they handle are only onomatopoeii, (for those who code, here's an example to detect Claps).

Now, the question. Is there a magic algorithm that does all the heavy work of comparing two audios from different speakers that is able to give a similarity score? If so, can you put me back to the tracks with a simple (well, as simple as it can be, of course) example, please?

Bonus track: Is any of the algorithms able to do the processing with precomputed values from the set of audio files?

  • $\begingroup$ Is it the same speaker and just different microphones? $\endgroup$
    – Jim Clay
    Commented Mar 21, 2014 at 15:11
  • $\begingroup$ Different speakers, everytime $\endgroup$ Commented Mar 21, 2014 at 15:21
  • $\begingroup$ Then this is an extremely difficult problem. $\endgroup$
    – Jim Clay
    Commented Mar 21, 2014 at 15:50

2 Answers 2


There is no (known) magic solution, as the sound of the same word from very different speakers are often not actually similar to one another in term of any simple characteristics such as you list (frequency range, intensity range, pitch, etc.)

To often, humans can only guess at what word is said from an unknown speaker based on context. And you don't have that with single word recordings.


What you want to do is by no means simple.

The devil is in the word "resemble". Resemble according to which propoerty of sound? Pronounced phonemes? Prosody? There are languages in which variations in the pronunciation in such or such phoneme are tolerated - while in other language these might be different phonemes. Pitch has little importance in some languages, moderate importance in some others (stress patterns), and is essential in a tone language.

Assuming you don't care about prosody and only phonemes, the simplest thing that could possibly work reliably would be the DTW of MFCCs, with one sequence of MFCC multiplied by the matrix that yields the smaller overall distance (as a form of vocal tract-length normalization).

  • $\begingroup$ I'd go for the simplest solution, as it should be computed by smartphones. Prosody is really tempting, but not needed. In fact, the audios I'll be using may have some accent, and I'll treat them the same way they were from other languages or so. Let's say I just want them to sound similarly. Do you have any algorithm exaplanation for MFCC+DTW? An implementation would be terrific, of course, thanks! $\endgroup$ Commented Mar 21, 2014 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.