I have computed the MFCCs for two audio files and applied the DTW to both sets of coeficients for both files. Now each such pair the two files is described by one single value (computed by the DTW). Let's call this value Diff.
If the audio files differ more, then Diff is greater, which is great. (so Diff is proportional to the difference between the audio signals - great!).
My problem is that Diff seems to be also proportional to the length of the files (?). Therefore, for two similar long audio signals, Diff might be greater than for two different short signals.
First I thought that, as DTW computes the shortest path for two arrays, the final value should be proportional to the lenght of the two arrays (i.e. the number of frames for each of the signals). So I tried dividing it by the product and by the average of the two lenghts but the results was discouraging (too big for some files that did not differ so much, too small for others).
Then I thought that if it is proportional to the lenght of the files, then dividing it to the average number of frames (in which I divided the two signals for computing the MFCCs) would do the trick... but it didn't...
Finally, I thought that, as the MFCCs are computed from the result of the FFT, the final DTW result might be proportional to the sum of the FFT magnitudes, so I tried dividing it by this sum (of the spectrum elements, returned by the FFT algorithm). Again, the results were not what I hoped them to be...
Right now I'm out of ideas... What is the DTW result depending on, what is it proportional to?
EDIT: Here are some values, after pichenettes' suggestion to try the geometric average of the lengths of the files:
- same sound . avgLengths = 106000. Diff = 409. Diff / avgLengths = 38
same sound . avgLengths = 191000. Diff = 609. Diff / avgLengths = 31
diff sounds. avgLengths = 80000. Diff = 437. Diff / avgLengths = 55
- diff sounds. avgLengths = 193000. Diff = 692. Diff / avgLengths = 35
38 > 35 :(
(the sounds from 2. and 4. are almost similar, and so are the ones from 1. and 3. In 1. the trailing silence for one file is a little longer)