Help - Search - Members - Calendar
Full Version: mp3 data difference calculation
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
AndyH-ha
We can compare a decoded mp3 file with the original source and get a file of sample values representing the difference. We know this does not tell us about what we hear, but it does reveal that the audio data is different. Is there a standard way of expressing that difference for any given file as a number, such as X%? If not, can anyone suggest a not terribly complex method of making such a calculation?
pdq
QUOTE(AndyH-ha @ Jan 6 2008, 01:00) *

We can compare a decoded mp3 file with the original source and get a file of sample values representing the difference. We know this does not tell us about what we hear, but it does reveal that the audio data is different. Is there a standard way of expressing that difference for any given file as a number, such as X%? If not, can anyone suggest a not terribly complex method of making such a calculation?

In my opinion any such numeric value would be equally meaningless, so pick whatever function you want, like the average of the absolute values.
slks
The changes that lossy encoding makes to audio cannot be quantified in a single number. That's all there is to it.
muaddib
QUOTE(slks @ Jan 9 2008, 08:16) *
The changes that lossy encoding makes to audio cannot be quantified in a single number. That's all there is to it.

Yes they can and the number is called ODG (Objective difference grade). Recommendation for standard ITU BS.1387 describes how to get that ODG. But it is not an easy procedure. And there are also available tools (EAQUAL for example) to get ODG. And BS.1387 is not the only way to get something like an ODG. And none of the tools is precise enough to be good replacment for SDG (subjective difference grade). There was recently discussion about this: http://www.hydrogenaudio.org/forums/index....showtopic=59835
pdq
The OP had asked about subtracting the two waveforms and quantifying the difference. This is very different from ODG.
AndyH-ha
Yes, I am aware that this view of the change has nothing to do with how anything sounds.

Audio is encoded to mp3. It must be decoded back to PCM to be played, or for various other things to be done with it.

While this is not always the case, and especially not when there is a series of re-encodings, wav to mp3 to wav produces a file that is the same size as the original, and contains the same number of samples. Some of those samples in the decoded wav file might be identical to the corresponding sample in the original source file, most will be different.

Taking one such sample, say the first where the final file has a different value from the original file, the amount of difference can be easily calculated. That absolute value of that difference can be expressed as a percentage of the original value, that sample has changed by X%. There is therefore a way to calculate the overall difference for the entire file and express it as a percentage change. Just what that might mean is not the question.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.