Search code examples
algorithmaudiotranscoding

How to detect generation loss of a transcoded audio


Lets say you have a 96 kbit mp3 and you Transcode the file into a 320 kbit mp3. How could you programmatically detect the original bit rate or quality? Generation loss is created because each time a lossy algorithm is applied new information will be deemed "unnecessary" and is discarded. How could an algorithm use this property to detect the transcoding of audio.

128 kbps LAME mp3 transcoded to 320 kbps LAME mp3 (I Feel You, Depeche Mode) 10.8 MB.
alt text

This image was taken from the bottom of this site. The 2 tracks above look nearly identical, but the difference is enough to support this argument.


Solution

  • One way to do it is to analyze spectrum of the signal. I'm not sure if it's possible to determine the exact original rate, but you can definitely tell between a real 320 kbps mp3 and the transcoded 96 -> 320 kbps. The 96 kbps mp3 will have higher frequencies cut at 15 kHz or so. The 320 kbps should have non-zero at around 18-20 kHz or even higher (that depends on the encoder).