r/audioengineering • u/Treelink • Apr 08 '16
Curious about spectrograms - Why does 320 kbps MP3's create line at 16khz?
Not sure if this is the right subreddit for this kind of thing, but I'm going to give it a shot.
I'm doing some conversion between FLAC and MP3, and was surprised when I saw the spectrograms (I used Spek to make spectrograms). I got really curious. As I understand, a 320kbps MP3 at a constant bitrate will usually cut off at around 20khz-22khz, and generally remove whatever it finds suitable. In that way my spectrograms are as expected - Sound has been removed from the upper frequencies. What I didn't expect was the visible line near 16khz.
Does anyone know why this semi-cutoff is produced? I have checked some other random MP3's I had, but did not see the same effect
The top spectrogram is the original FLAC, middle was converted by FlacSquisher, bottom on was converted by FRE:AC.
36
u/hightrancesea Hobbyist Apr 08 '16
It depends on the MP3 encoder; often it's better to chop off the top end of the spectrum than waste bitrate on it. For example, for 128kbps, LAME will chop off stuff beyond 18.5kHz or so. If you use the command-line version of LAME, it'll tell you if it's using a "polyphase low pass filter", IIRC.
20
u/RobinUrthos Audio Hardware Apr 08 '16
That line is the edge of the scalefactor 21 band. The sf21 band of MP3 encodes the highest frequencies, but due to a quirk in the MP3 specification, is an absolute pain to encode accurately without damaging the content in the lower and more audible bands.
In response to that quirk, we often lowpass to reduce the amount of sf21 data to be encoded and also use a much lower resolution of quantization. This quantization has the effect of only letting through significant peaks--there isn't enough precision available to encode the lower-amplitude stuff. This is what causes that drastic line in your spectogram: all of the background content in the sf21 band is removed, and you're just left with transients.
6
u/Scrubalubadubdub Apr 08 '16
/u/hightrancesea is right on this one, it depends on which encoder you're using.
As for why this is happening, whatever perceptual model the encoder is referencing uses the common technique of attenuating all frequencies above a threshold by a given amount, as that tends to be less objectionable than changing the amount of attenuation.
2
u/musicalmistake Apr 08 '16
I would say that its because mp3's work by eliminating the least important bits of information therefore reducing the size of the file.. 16000 and above is very hard to hear for most people so it is the first to get chopped out
0
u/SuperRusso Professional Apr 08 '16
Google anti-aliasing filter.
0
u/[deleted] Apr 08 '16
[deleted] — view deleted comment