MP3 bitrate detection through frequency spectrum analysis
Is there any program that detects the bitrate of an MP3? I'm not talking about the effective bitrate that the file has been encoded with, but the real bitrate that can be calculated only by frequency spectrum analysis.
For example, if I have an MP3 encoded in 128 kbps whose size is 1 MB, and then I transcode this MP3 to 320 kpbs whose size becomes 3 MB, I will have the same identical audio track, but with different sizes.
If I have a 320 kbps MP3 and I transcode it to 128 kbps I will lose some quality and therefore some file size.
But stil开发者_运维知识库l, I have no way to verify that 320 kbps is my MP3's "real" bitrate.
Details are explained in this paper: http://www.fileden.com/files/2009/2/14/2321055/My%20Documents/MP3%20Bit%20Rate%20Quality%20Detection%20through%20Frequency.pdf
Firstly, https://www.google.com/?q=mp3+cutoff+frequency can be quite enlightening.
Secondly, almost all MP3 are encoded using presets with quite standard polyphase lowpass filters. Since it is actually impossible to achieve lossless compression with MP3, what is lost is actually the higher harmonics of the base frequencies (see FFT, DCT, wavelet transforms etc); the filter is applied so that the results of later Fourier analysis of the spectrum is more coherent with human hearing range (ie unhearable/masked frequencies are eliminated from the analysis at all). It's actually impossible to achieve a high compression without cutting off/severly distorting higher frequencies, since it's actually them that occupy most of the space in the bit stream.
Of course, without the cutoff the frequency domain limiting would be less accurate - but it would still occur. The cutoff is applied, amongst other reasons, so that the compression artifacts are generated outside of the psychoacoustic hearing range.
As a point of reference - do a spectrum analysis of the stream (realtime SA with Winamp clone would suffice if the higher frequency ranges are saturated enough, you can also simply do a spectrogram if you have the tools), and find the cutoff point. In below example, the cutoff occurs @ 15 kHz, which informs me the stream was originally compressed @ 128 kbps ; I'd even go so far to say it's actually possible to distinguish <= 128 kpbs streams by ear with many kinds of music (drum'n'bass and other electronic music genres with lots of highs come to mind).
The most common cutoffs are: (note that they are "hard" in CBR and "soft" in ABR/VBR)
- 128 kbps : 15-16 kHz (very audible on rock/electronic music! "loss of space" effect)
- 192 kbps : ~19 kHz (barely audible in most cases, considered transparent by most)
- 256-320 kbps : > ~20kHz (inaudible)
Yes, I'm aware that some people can hear above 20 kHz, but the masking effect appearing in music plus the actual response times from the speakers means that in actual music 20 kHz cutoff is irrelevant to sound quality.
source: own reasearch as an audio engineer plus https://web.archive.org/web/20150313010213/http://www.whatinterviewprep.com/prepare-for-the-interview/spectral-analysis/ as an additional reference
The cutoff frequency and the bit rate are independent. Yes, the majority of people use presets, therefore there is a correlation between the two, but it's not deterministic.
Only thing that you can easily determine from the frequency spectrum analysis is what is the sampling frequency of the input mp3 file.
For example, if your mp3 is sampled at 44100, you won't have any sound above 22050hz and that will be clearly visible on the spectrum graph.
Since you are crossing into transcendental domain here, try this:
- encode mp3 to 128kbps
- transcode it to say 320kbps
- try RAR-ing or 7Z-ing resulting file and original file. Observe compression ratios.
Their 'entropy' ie. randomness will differ, and maybe that number will tell you something about how much information is 'fabricated' in bitrate expansion during transcoding.
You can open file "Adobe Audition" or "Cool Edit" and open frequency analysis window. If frequency lines to 20khz ore more mp3 bitrate maybe 320 kbps if frequency lines cut smaller then 20khz it's not 320kbps.
精彩评论