Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WAV differential evaluation of MP3 (Read 9501 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WAV differential evaluation of MP3

To produce an audible comparison of various MP3 files to the original, I am trying to find software that will produce a WAV file that is the difference between the best match between two sample WAV files. 

If File1.WAV is the original, and is converted to File2.MP3 and then reconverted to File3.WAV, the difference between File1.WAV and File3.WAV should reveal the sound lost in compression, provided that one can match the sync and levels appropriately. 

I have found FLAC software that will do sync and amplitude matching and produce a FLAC file of the difference, but I haven’t found any references a similar WAV file comparator.

EAC and foobar only tell you that files are different and where.  They don’t generate a file of the differentials as far as I can tell.

Anyone know of appropriate software?

WAV differential evaluation of MP3

Reply #1
The difference between 1 and 3 is meaningless. You cannot determine the quality of an MP3 file from the difference.

To produce an "audible comparison" start an ABX test between the original and the MP3. That will determine whether you can hear a difference - which is infinitely more important than listening to a difference signal that will just confuse the listener.

WAV differential evaluation of MP3

Reply #2
If File1.WAV is the original, and is converted to File2.MP3 and then reconverted to File3.WAV, the difference between File1.WAV and File3.WAV should reveal the sound lost in compression, provided that one can match the sync and levels appropriately.


While it'd make testing easy if that really worked, it'd also mean lossy audio compression would be pretty useless, so maybe its a good thing it doesn't

WAV differential evaluation of MP3

Reply #3
This can be done with some difficulty in a program like Adobe Audition. Rip a file as an uncompressed .wav file. Invert the phase of the file (polarity, actually...must invert BOTH CHANNELS!), then save the resultant file in a lossy format like mp3.

Open both files in the multitrack view, each in it's own "track", making certain that they are time aligned. Hit play. What comes from the speakers is what mp3 encoding removed...the difference between the two. And at high bitrates is's very, very little. The result usually sounds like a very, VERY quiet whisper, vaguely related to the music having been recorded. Pretty interesting.

By the way, if you get a HUGE, LOUD sound...you did it wrong. You didn't invert the phase, or didn't get the two files exactly aligned in time.

WAV differential evaluation of MP3

Reply #4
This can be done with some difficulty in a program like Adobe Audition. Rip a file as an uncompressed .wav file. Invert the phase of the file (polarity, actually...must invert BOTH CHANNELS!), then save the resultant file in a lossy format like mp3.

This is not good way of testing. If you really want to hear a difference between mp3 and original, then invert decoded mp3 not the source of encoding. And even then it is bad test, because you can turn up the volume, enough to be able to hear differences. This volume would be too loud for normal listening in many cases.

WAV differential evaluation of MP3

Reply #5
I wouldn't describe the difference as a "whisper" - in fact, given that the original and encoded files sound (virtually) identical, it's amazing that the mathematical difference is so large (loud).

Sample accurate time alignment is a pre-requisite for making this work.

Be aware that invert-mix-paste in many applications will introduce small errors (or in some cases huge errors!) if the signal contains samples at digital full scale, because positive digital full scale is +32767 and negative digital full scale is -32768 - and hence can't be inverted correctly (i.e. there's no +32768 value available).


The amplitude or loudness of this difference signal is not an indication of the perceived quality of the encoding - where the noise is all masked by the original signal, the difference can be quite loud yet the encoded file sounds identical to the original. Where the noise is just pure uncorrelated white noise, it could have a much lower amplitude, and sound much quieter on its own, and yet still be easily audible in the presence of music or speech (e.g. cassette hiss!).

Cheers,
David.

WAV differential evaluation of MP3

Reply #6
Be aware that invert-mix-paste in many applications will introduce small errors (or in some cases huge errors!) if the signal contains samples at digital full scale, because positive digital full scale is +32767 and negative digital full scale is -32768 - and hence can't be inverted correctly (i.e. there's no +32768 value available).



Interesting!  Thanks.  Underr what conditions will this introduce huge errors, though?

WAV differential evaluation of MP3

Reply #7
for 16-bit integer, -(-32768) = -32768.

WAV differential evaluation of MP3

Reply #8
I wouldn't describe the difference as a "whisper" - in fact, given that the original and encoded files sound (virtually) identical, it's amazing that the mathematical difference is so large (loud).

Sample accurate time alignment is a pre-requisite for making this work.


It is true that there are cases where the sources are seemingly identical, but perfect time alignment is not possible. For example, the  same analog source encoded to digital with any error at all in start time or clock frequency.

I've been known to upsample two sources to unbelievably high frequencies (up in the MHz range) to get the time-alignment good enough.

 

WAV differential evaluation of MP3

Reply #9
This can be done with some difficulty in a program like Adobe Audition. Rip a file as an uncompressed .wav file. Invert the phase of the file (polarity, actually...must invert BOTH CHANNELS!), then save the resultant file in a lossy format like mp3.

Open both files in the multitrack view, each in it's own "track", making certain that they are time aligned. Hit play. What comes from the speakers is what mp3 encoding removed...the difference between the two. And at high bitrates is's very, very little. The result usually sounds like a very, VERY quiet whisper, vaguely related to the music having been recorded. Pretty interesting.

By the way, if you get a HUGE, LOUD sound...you did it wrong. You didn't invert the phase, or didn't get the two files exactly aligned in time.


That all said, analysis of the difference between wav files often tells us little or nothing about whether they sound the same or different.