320kbps MP3 - Why is there a clear line near 16khz on spectrogram?

I'm doing some conversion between FLAC and MP3, and got the results below, shown in Spek. I got really curious. As I understand, a 320kbps MP3 at a constant bitrate will usually cut off at around 20khz-22khz. In that way my spectrograms are as expected. What I didn't expect was the visible line near 16khz. Where does this come from, and why does it appear. I have checked some other random MP3's I had, but did not see the same.

Anyone want to throw a guess? The top spectrogram is the original FLAC, middle was converted by FlacSquisher, bottom on was converted by FRE:AC.

• It's possible that your MP3 encoder lopasses it's input -- I've heard of at least one AAC encoder doing that. – Linuxios Apr 8 '16 at 22:58
• Here is an answer I gave a while back on LAME encoder. It might explain a bit. – Marc W Apr 9 '16 at 13:16

Do you know what mp3 codec is being used? Frauhenhoffer/lame etc all use different techniques to compress the audio.

For example, the Lame VBR, even at its highest setting V0 will cut off anything above 20KHz and use the bandwidth saved to keep more of the sounds you can actually hear. (Remember most human hearing only goes up to 16KHz)

The non VBR Lame codec (320 etc) will keep that info in there, possibly at the very slight detriment of sounds lower down.

The one you are using has decided to remove most of anything above 16KHz, whilst retaining what it feels are sounds that would benefit from being retained.

Can you hear any difference?

MP3 encoding employs psychoacoustic techniques like masking (in both frequency and time domain) to reduce the complexity of encoded audio whilst not perceptually sacrificing quality.

What you're seeing is the visual representation of quantised high frequency content not being encoded to save on arguably unneeded bits. The encoder model decides this, and it's in part due to scaling factors and the bands into which the source signal is divided prior to being processed and encoded.

Marc W's prior explanation of the Spectral Reproduction content answers your question, and is an excellent read. You can go for the 'APE' preset if you want to 'lock off' all of the scale factors at the same quality, but I wouldn't.

Why? IMO the benefit obtained due to the ear's response curves, and the importance of preserving accuracy of spectral content in that key frequency band, is going to outweigh maxing out the quality of all bands (including the >= 16 kHz band), and possibly introducing frequency artifacts not present in the source audio due to disabling a beneficial feature of the MP3 encoder.

• Which build of LAME are you using, did it install one with? I'd upgrade to the latest version separately.
• What command switches is it indicating it's using to encode the 320s?
• If you manually encode from FLAC using the latest LAME and specify -b 320 or -V 0 then compare, what do you see?

I would personally use -V 0 instead of -b 320 unless you need CBR due to decoder limitations. Having done a lot of blind comparisons over the past few years, LAME VBR wins over just about everything. -V 0 also has no lowpass.

Over time I came to realise - if I feed foo_abx with a 320 and a V0 VBR, can I tell them apart? If not, I always pick V0.

Personally I now encode as AAC-LC (at least 256 kbps) or one of the tuned Vorbis (e.g. AoTuV), I find them more transparent in the time domain and often more accurate at reproduction than MP3 (even with Vorbis's acknowledged pre-echo quirkiness). Entirely subjective.

This may be an interesting read if you're interested in the technical capabilities of FLAC, AAC and MP3 at various bit rates when pushed to extremes with test waveforms.

Vorbis and MP3's encoding methods and acoustic models are rather dated and AAC is the new king of cross-platform compatibility. AAC improves upon the encoding methods used by MP3. Even my old Rockboxed iRiver and my car (via A2DP) merrily decode AACs with higher quality and lower file sizes.

Nothing including the signal chain is usually perfect. Can you guarantee your decoder and/or player won't be doing output dithering or some other funkiness? Headphone drivers usually do far more to alter the output signal than any particular codec choice.

If you want completely neutral reproduction, play FLACs through some HD800-S and its matched HDVD800 amp ;-)

Here's some fun (oh yes!) scale factor and acoustic model reading:

Has your brain melted yet?