开发者

Comparison of two waveforms of audio files

开发者 https://www.devze.com 2023-04-12 04:52 出处:网络
I am a VC++ developer and currently need help in comparing two audio files. Lets say I have two wave files and one of it is created using the other with some modifications like lowering the loudness e

I am a VC++ developer and currently need help in comparing two audio files. Lets say I have two wave files and one of it is created using the other with some modifications like lowering the loudness etc.

Now, I have to compare these files and see if the modified one is almost copy of the original one, means, while creating the modified one, my application has unknowingly not distorted the file.

A percentage value would be better to signify how much different these files are. I have tried taking FFT of both files and then computing th开发者_运维百科e difference in dB (like, 10 * log10 (ft1/ft2)) and averaging out the result. i get a resultant number but I am not sure what that number signifies.

Thanks in advance for any kind of help.


The number you obtain doesn't really signify anything aside from how similar the spectra are. There are so many ways of modifying an audio file and so many ways of comparing them that it's impossible to give a general answer. If you know exactly which modifications are made then you can do a reasonable job. For instance if you know that the only modification is that the volume has been changed by a constant factor then if you take the squared magnitude of the FFT and normalise it (ie rescale so that the peak is 1.0) then this will be identical for the original and modified signals. You can calculate the sum of the differences of the two FFT magnitudes, but this is just a number and you can't convert it to a percentage in any meaningful way (what does it mean if I say two sounds are 30% different?)

So I would step back a bit and work out the problem that you're actually trying to solve.

0

精彩评论

暂无评论...
验证码 换一张
取 消