3

After analysing various converted mp3's I've found out that the LAME encoder uses a lowpass filter for the insane preset (CBR 320), but the filter seems to be disabled for the extreme preset (VBR V0). That doesn't make sense right? I'm wondering why that is the case and what would be the best practice regarding the filter if filesize doesn't really matter.

Original Flac file:

original

Extreme preset:

$ lame  original.wav --preset extreme --lowpass -1 extreme.mp3
    LAME 3.99.5 64bits (http://lame.sf.net)
    polyphase lowpass filter disabled
    Encoding original.wav to extreme.mp3
    Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=0)
    Writing LAME Tag...done
    ReplayGain: -3.4dB

extreme

Insane preset:

$ lame  original.wav --preset insane insane.mp3
    LAME 3.99.5 64bits (http://lame.sf.net)
    Using polyphase lowpass filter, transition band: 20094 Hz - 20627 Hz
    Encoding original.wav to insane.mp3
    Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (4.4x) 320 kbps qval=3
    Writing LAME Tag...done
    ReplayGain: -3.4dB

insane

Insane preset with lowpass disabled:

$ lame  original.wav --preset insane --lowpass -1 insane.mp3
    LAME 3.99.5 64bits (http://lame.sf.net)
    polyphase lowpass filter disabled
    Encoding original.wav to insane.mp3
    Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (4.4x) 320 kbps qval=3
    Writing LAME Tag...done
    ReplayGain: -3.4dB  

insane --lowpass -1

3

This is an anti-aliasing filter. The --preset insane settings must allow aliasing to become apparent.

Your iPhone can't reproduce the frequencies the filter is applied to anyway, and if it could, you wouldn't hear them.

Disabling the filter would likely lead to a very slightly larger file, and some unwanted (lower) frequencies caused by aliasing. An anti-aliasing filter helps suppress this unwanted side effect of digital conversion and compression.


More About LAME Presets and Filters

LAME Low-Pass Filters

Let's look at the chart you posted here. (from wiki.hydrogenaud.io) enter image description here
The LPFs(low-pass filters) in this chart are not primarily anti-aliasing filters. They are there for a few different reasons, one of which being the fact that for a specific preset, there is a maximum frequency that can be reliably stored; as the bitrate increases, the maximum frequency that can be reliably stored increases and so the cutoff frequency of the LPF is increased accordingly, until the quality of compression is such that a LPF is no longer required or desired. (The LPF frequency ranges displayed in the chart are transition periods.)

I can't give an exact reason for --preset extreme not having an anti-aliasing filter, but as an educated guess, I'd say it was simply tested and found not to be necessary. These presets have been extensively tested and tweaked for optimum performance or quality, or to find a balance of the two, depending on the preset.

The Y Switch

What's interesting is that --preset insane has the -Y switch enabled. Now the Y switch is a bit more complicated. A quote from a Hydrogenaudio Wiki page on this subject attempts to explain it in a single sentence;

The Y switch prevents global gain quantization from being decreased solely to accommodate the needs of sfb21.

In the MP3 format, audio is processed in bands of frequencies. Band 21, or 'sfb21' handles the 16kHz plus(for 44.1kHz SR) frequencies. The difference between sfb21 and the rest of the bands, is that the sfb21 'scale factor'(it's quality, basically) cannot be independently adjusted. So if the quality of the sfb21 band needs to be increased, all the bands are consequently increased. So what the Y switch does, basically, is prevent the quality of the lower frequencies from increasing, just because sfb21 needs to be increased. Bear in mind, the -Y switch can only be activated in VBR mode. This is because in effect, the Y switch is implicit in CBR and ABR modes.

Absolute Best Quality?

I've read some threads with people asking how to get the absolute best quality from the LAME encoder. Most replies state that --preset insane has been tweaked to allow the best possible quality, but some people seem to think that disabling the Y switch is a possible way to achieve better quality. Perceived sound quality is subjective, and will always be a much debated subject.

What are the best settings? Well, the answer to this is repeated a lot on this site, and I think it's relevent here; "whichever sound the best to you".


Relevant Links
Anti-aliasing Filter
MP3 Encoding
The Y Switch and the sfb21
Encoding Quality Guide
Encoding Quality Improvement?
Why MP3s Omit HF Content
LAME Maximum Quality and Archiving

  • Thanks for upgrading your comment to an answer. I think I understand what you're saying. But it it makes sense to keep the filter enabled, why is it not enabled in V0 by default then? That would also makes sense right? – Tieme Jan 25 '16 at 12:48
  • I have updated the answer, I hope it explains a bit more. – Marc W Jan 31 '16 at 2:18
  • Not sure how recent is this change but --preset insane is now using a lowpass filter as well (wiki.hydrogenaud.io/index.php?title=LAME#Technical_information). – jj_ Feb 18 at 21:48
0

i found this in LAME´s manual:

"Using a lowpass filter helps reducing the amount of data to encode. This is important in MP3 due to a limitation in very high frequencies (>16Khz). The default value depends on the target bitrate/quality. It is not recommended to change it as a general basis."

I undertand if u don´t use a LPF the excessive amount of very high frecuencies could reduce a valuable space where to store the lowest frecuencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.