Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

visual c++ - Comparison of two waveforms of audio files

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 the 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...