Rivers1080p
Oct 23 2006, 22:20
It's supposed to be "used with care".
When do I use it?
Is it just at very high bitrates like -V0 or 320 CBR?
It must have a purpose or else it would not be available...
JensRex
Oct 23 2006, 22:37
QUOTE (Rivers1080p @ Oct 23 2006, 23:20)

When do I use it?
Never.
LAME has many experimental switches that should never be used for archiving. Just because it is there, doesn't mean it should be used. Consider stuff like --nores and --allshort. They're there, but one would be a fool to use them.
hvidgaard
Oct 23 2006, 22:43
My memory tells me that it makes LAME to encode all 44.1KHz (bandwidth) of the source file, but that would be a VERY bad idea... normally LAME more or less cuts everything above 20KHz away, so you do the math why not to use it
dv1989
Oct 23 2006, 22:51
That's not true; assuming 44.1kHz input, -k would come closer to encoding all 22.05kHz of the input file's frequencies.
JensRex
Oct 23 2006, 23:16
I can't be arsed to explain why this is a bad idea. This topic has been beaten to death already, raised as an unholy zombie, and then beaten again. Use the search.
gameplaya15143
Oct 23 2006, 23:20
QUOTE (Rivers1080p @ Oct 23 2006, 17:20)

When do I use it?
Anytime you want to.
There are other variables that also determine the amount of high frequency noise that gets encoded, especially if it is used at lower bitrates (ATH, psymodel, & sfb21 type stuff).
When used with -V 0 it would/might just result in a higher average bitrate.
JensRex
Oct 23 2006, 23:57
QUOTE (gameplaya15143 @ Oct 24 2006, 00:20)

When used with -V 0 it would/might just result in a higher average bitrate.
Yes, and a lower quality sound, because the frames that needed 320 kbps before you added the switch to disable all filters, now has to contain inaudible content along with the audible content in the same 320 kbps - you sacrifice bits encoding stuff you can't hear, for stuff you can hear.
There are a 1000 ways to shoot yourself in the foot with LAME. -k is one of them. Don't use it. End of thread.
You could use it if using 640kbps freeformat, maybe.
kjoonlee
Oct 24 2006, 05:50
QUOTE (gameplaya15143 @ Oct 24 2006, 07:20)

QUOTE (Rivers1080p @ Oct 23 2006, 17:20)

When do I use it?
Anytime you want to.
You don't want to. Trust me.
One of the purposes of low-pass filtering in audio is anti-aliasing.
Rivers1080p
Oct 24 2006, 16:02
Thanks! "-k" = bad idea
[speculation] Could it have it's use if I wanted to recode an MP3 track (or rip a CD made from MP3's) where the file/track has had a lowpass filtering applied allready? Say I wanted to make a -V5 version of my -V2 encoded MP3's? In this situation it may not matter if I use it or not. [/speculation]
Klyith
Oct 24 2006, 16:14
QUOTE (Rivers1080p @ Oct 24 2006, 11:02)

[speculation] Could it have it's use if I wanted to recode an MP3 track (or rip a CD made from MP3's) where the file/track has had a lowpass filtering applied allready? Say I wanted to make a -V5 version of my -V2 encoded MP3's? In this situation it may not matter if I use it or not. [/speculation]
No, the v5 wants a lower lowpass than the v2 mp3s received when they were encoded. That's one of the ways they can have a smaller bitrate.
Also AFAIK when mp3s are decoded there will be non-zero audio in frequencies above the lowpass, but it is just random quantization noise. It's small enough to be inaudible when listening, but you don't want the encoder to be paying attention to it when re-encoding.
Pio2001
Oct 24 2006, 23:15
You need to use it if, for a given reason, you have to encode sweep tones or test tones like white noise into MP3 for audition testing or measurment purposes.
In this case, you would also have to check that your tones are still intact after encoding.
shadeLL
Oct 29 2006, 02:00
How about when you are transcoding from a compressed file that has already been low passed at a lower level than Lame uses?
E.g. I often use Lame to transcode mp2s captured from digital TV or radio.
The mp2s at 192kbps have already been low passed with a transition band of 15-16KHz.
The ones at 256kbps have been low passed with a transition band of 18-19Khz.
Lame aps uses 18.77-19.355KHz.
I heard an improvement in quality with the 256kbps stuff by using -k. Note that if I had asked Lame to low pass, its filter would have overlapped the existing one, giving a funny shaped transition band.
However, my high frequency hearing is not great, getting nowhere near 18K on a test sweep, so I wondered if the improvement in detail I heard was simply due to the fact that the audio had been through one less process. The filter must surely mangle the signal a bit?
I would appreciate comments from Lame developers or other equally knowledgeable people on this, and whether there could be any problem with -k in this situation.
You seem to believe that your MP2s, because they were filtered, contain nothing above the cutoff frequency, but in fact what they have is quantization noise in this frequency range. Using the -k switch is telling LAME that you want that noise encoded, which it will try to do, using bits that could have been better used to encode things that you can actually hear.
Mike Giacomelli
Oct 29 2006, 03:33
QUOTE (shadeLL @ Oct 28 2006, 18:00)

I heard an improvement in quality with the 256kbps stuff by using -k. Note that if I had asked Lame to low pass, its filter would have overlapped the existing one, giving a funny shaped transition band.
You want the lowpass to be the same ideally, that way the minimum amount of quant noise will propigate into your new file. I don't know what you mean by "a funny shaped transition band".
QUOTE (shadeLL @ Oct 28 2006, 18:00)

However, my high frequency hearing is not great, getting nowhere near 18K on a test sweep, so I wondered if the improvement in detail I heard was simply due to the fact that the audio had been through one less process.
I don't think you heard an improvement. At least it seems very unlikely that reducing the bitrate available for the actual audio would improve quality.
QUOTE (shadeLL @ Oct 28 2006, 18:00)

The filter must surely mangle the signal a bit?
Not meaningfully.
QUOTE (shadeLL @ Oct 28 2006, 18:00)

I would appreciate comments from Lame developers or other equally knowledgeable people on this, and whether there could be any problem with -k in this situation.
Its a dumb idea. Just set the lowpass properly.
Klyith
Oct 29 2006, 03:35
QUOTE (shadeLL @ Oct 28 2006, 21:00)

How about when you are transcoding from a compressed file that has already been low passed at a lower level than Lame uses?
QUOTE (Klyith @ Oct 24 2006, 11:14)

Also AFAIK when mp3s are decoded there will be non-zero audio in frequencies above the lowpass, but it is just random quantization noise. It's small enough to be inaudible when listening, but you don't want the encoder to be paying attention to it when re-encoding.
I believe mp2 and probably most other lossy compressed files that use MDCT will have this quantizer noise. Mp2 could be different since it is a subband encoder so it might not have this noise effect in frequency bands that it discards...
Regardless, the lame psychoacoustic model probably knows your ears better than you do.
QUOTE
I heard an improvement in quality with the 256kbps stuff by using -k. Note that if I had asked Lame to low pass, its filter would have overlapped the existing one, giving a funny shaped transition band.
Did you hear this during an ABX test? (Please review TOS #8.)
QUOTE
However, my high frequency hearing is not great, getting nowhere near 18K on a test sweep, so I wondered if the improvement in detail I heard was simply due to the fact that the audio had been through one less process. The filter must surely mangle the signal a bit?
The lowpass filter is a 1024 sample Fast Fourier Transform, so no, it doesn't mangle anything. I would guess the improvement in detail is simply placebo.
shadeLL
Oct 29 2006, 04:21
QUOTE (Mike Giacomelli @ Oct 29 2006, 03:33)

You want the lowpass to be the same ideally, that way the minimum amount of quant noise will propigate into your new file. I don't know what you mean by "a funny shaped transition band".
If you overlay two filters at the same point, that would give a transition that's twice as steep. I thought a steep filter was meant to be a bad thing.
QUOTE (Klyith @ Oct 29 2006, 03:35)

Also AFAIK when mp3s are decoded there will be non-zero audio in frequencies above the lowpass, but it is just random quantization noise. It's small enough to be inaudible when listening, but you don't want the encoder to be paying attention to it when re-encoding....I believe mp2 and probably most other lossy compressed files that use MDCT will have this quantizer noise. Mp2 could be different since it is a subband encoder so it might not have this noise effect in frequency bands that it discards...
A frequency analysis of the source looks like this:

I don't see any noise.
QUOTE (shadeLL @ Oct 28 2006, 23:21)

I don't see any noise.
I also don't see any reason to pass anything over 16 kHz.
cabbagerat
Oct 29 2006, 07:08
QUOTE (shadeLL @ Oct 28 2006, 19:21)

QUOTE (Mike Giacomelli @ Oct 29 2006, 03:33)

You want the lowpass to be the same ideally, that way the minimum amount of quant noise will propigate into your new file. I don't know what you mean by "a funny shaped transition band".
If you overlay two filters at the same point, that would give a transition that's twice as steep. I thought a steep filter was meant to be a bad thing.
Steep filters aren't "a bad thing", in fact they are a very good thing. It's some of the side effects that come with trying to achieve steep filters that are bad. Some of these bad effects of steep digial filters are passband ripple (with some types of filters), computational inefficiency (with long FIR filters, especially), group delay (only important in realtime systems) and phase distortion (only in some types of filters). None of these should prove a problem in the scenario you present.
Like pdq, I can't see any reason to encode the quantization noise above 16kHz - you'll just waste bits.
David Nordin
Oct 29 2006, 09:31
It surely would make more sense for the LAME developers to simply drop the -k switch from the stable/mainstream releases of LAME.
There is absolutely no reason to use the -k switch with a limited format such as MP3 and there is no sense continuing this discussion either.
There are, among some noise, perfectly good answers above.
The wiki should also explain the disadvantage of -k along with many, many, many forum posts...
Klyith
Oct 29 2006, 13:23
QUOTE (David Nordin @ Oct 29 2006, 04:31)

It surely would make more sense for the LAME developers to simply drop the -k switch from the stable/mainstream releases of LAME.
There is absolutely no reason to use the -k switch with a limited format such as MP3 and there is no sense continuing this discussion either.
There are, among some noise, perfectly good answers above.
The wiki should also explain the disadvantage of -k along with many, many, many forum posts...
It would make sense for the devs to drop a
lot of the switches... An encoder like the Nero command line AAC doesn't have people suggesting new combinations of switches every week, because all you can do is set quality. I think the only think that prevents people from saying the same nonsense about vorbis is the relatively smaller user base.
("Hey, if I set lowpass to 44.1 and use managed bitrate mode with these settings it sounds a lot better to me!" *shudder*)
But they won't get rid of the extra switches since lame is open source and there are people who use the experimental switches or their intended purpose, which is testing the encoder.
dv1989
Oct 30 2006, 21:51
If the switches are only really usable or beneficial for testing purposes, could they not be made usable in alpha versions only? I know that one or more switches are already like this.
cabbagerat
Oct 31 2006, 09:05
QUOTE (dv1989 @ Oct 30 2006, 12:51)

If the switches are only really usable or beneficial for testing purposes, could they not be made usable in alpha versions only? I know that one or more switches are already like this.
Or possibly with another flag, such as --enable-testing-mode or --disable-decent-quality

The LAME devs give us a great product which is easy to use, and fairly hard to misuse. The fact that people use it wrong (ignoring the documentation) then say "LAME sux! L0L!" is unfortunate.
shadeLL
Nov 9 2006, 01:57
Mp3 encoders work by splitting the sound up into its frequency components, and throwing away the ones that won't be heard. Is the lowpass filtering in Lame done at this stage? Or is it a separate filter that's applied 1st?
SirChristof
Nov 9 2006, 02:18
QUOTE (David Nordin @ Oct 29 2006, 03:31)

It surely would make more sense for the LAME developers to simply drop the -k switch from the stable/mainstream releases of LAME.
There is absolutely no reason to use the -k switch with a limited format such as MP3 and there is no sense continuing this discussion either.
I strongly disagree. A switch that can be and is used for testing purposes being removed just because the general consensus is that it results in inferior quality overall?
(UDial cannot be properly encoded without -k

)
Downsampling a stereo signal to mono will reduce quality. Why not drop support for downsampling to mono too?
Obviously I mean that very sarcastically.
The best course of action is simply to update the description of the switch in the help file that comes with most lame compiles, such that is CLEARLY STATES that it will merely disable all lowpass(or highpass) filtering, which in almost all cases results in worse quality.
The switch is there, and I enjoy having options. Leave it as is.
QUOTE
A switch that can be and is used for testing purposes being removed
But we suggest this for non-testing builds!

However, I do agree with respect to your suggestion of updating LAME's documentation. That could really do with being done . . . simplifying and clarifying the process of using LAME, and hopefully educating n00bs and discouraging them from asking if adding every obscure and arcane switch will "1mpr0ve meh f1lessz!".
</rant>
Gabriel
Nov 10 2006, 09:40
QUOTE (SirChristof @ Nov 9 2006, 03:18)

The best course of action is simply to update the description of the switch in the help file that comes with most lame compiles, such that is CLEARLY STATES that it will merely disable all lowpass(or highpass) filtering, which in almost all cases results in worse quality.
It's done since several years. People simply don't read the doc.
Can an MP3 encoder feeded with a full bandwidth audio (i.e. -k switch) make a decision based on a given -V value whether to encode or not hi-frequency part of audio? Surely, full-bandwidth processing is an extra and in the most cases unnecessary work, but I'm just curious what are the other reasons (may the psychical model fail, etc.)?
shadeLL
Nov 13 2006, 02:06
QUOTE (Egor @ Nov 12 2006, 18:31)

Can an MP3 encoder feeded with a full bandwidth audio (i.e. -k switch) make a decision based on a given -V value whether to encode or not hi-frequency part of audio? Surely, full-bandwidth processing is an extra and in the most cases unnecessary work, but I'm just curious what are the other reasons (may the psychical model fail, etc.)?
I think this is closely related to the question I asked at the end of page 1, which seems to have been overlooked.
QUOTE (shadeLL @ Nov 9 2006, 00:57)

Mp3 encoders work by splitting the sound up into its frequency components, and throwing away the ones that won't be heard. Is the lowpass filtering in Lame done at this stage? Or is it a separate filter that's applied 1st?
Can anyone enlighten us?
It would make the most sense if it was lowpassed before anything else is done.
QUOTE (Firon @ Nov 13 2006, 09:06)

It would make the most sense if it was lowpassed before anything else is done.
OK, it's clear

. What is unclear is why may ringing artifacts occur with VBR and the -k option?
shadeLL
Nov 15 2006, 02:43
QUOTE (Firon @ Nov 13 2006, 03:06)

It would make the most sense if it was lowpassed before anything else is done.
If the lowpassing can be done at the next stage anyway, it doesn't make more sense, at least not for any obvious reason. If you know of a reason why it makes more sense please say, but really I am looking for an answer from someone who *knows* what it does.
Gabriel
Nov 15 2006, 13:07
The lowpass is not just a decorative thing. Disabling the lowpass is really disabling the lowpass.
It does not means that every high freq will survive, as there is still the adaptative quantization and the ATH is considered, but it will clearly decrease quality.
shadeLL
Nov 15 2006, 21:26
QUOTE (Gabriel @ Nov 15 2006, 12:07)

The lowpass is not just a decorative thing. Disabling the lowpass is really disabling the lowpass.
It does not means that every high freq will survive, as there is still the adaptative quantization and the ATH is considered, but it will clearly decrease quality.
I think that is relevant to Egor's question, but it doesn't answer mine.
My understanding of what Lame does is it splits the audio signal into it's component frequencies and throws out the ones that cannot be heard (using the ATH curves, and other stuff).
If it is doing that, is the lowpassing done as part of this split? i.e. are the frequency components above a certain level thrown away at this stage?
Or is the lowpassing done as a separate filter before hand? (and if so why?)
Please tell me if I am misunderstanding something.
AstralStorm
Nov 15 2006, 22:07
Think: you have a loud drum hit gets cut to 13 kHz.
If you use masking from before lowpassing, you'll get ringing - the masking frequency went away.
Another case - you have a very quiet HF tick that gets lowpassed to 13 kHz.
It disappears entirely, but ATH still thinks there's some quiet sound and PE estimator ups allocated bits.
-k also disables the highpass filter, possibly encoding useless very low frequencies and DC noise.
Gabriel
Nov 16 2006, 10:07
QUOTE (shadeLL @ Nov 15 2006, 21:26)

My understanding of what Lame does is it splits the audio signal into it's component frequencies and throws out the ones that cannot be heard (using the ATH curves, and other stuff).
If it is doing that, is the lowpassing done as part of this split? i.e. are the frequency components above a certain level thrown away at this stage?
Or is the lowpassing done as a separate filter before hand? (and if so why?)
Lame, as most encoders, is mostly not removing parts of the frequency spectrum, but decreasing precision in some frequency bands. The only hard-removed freqs are at the lowpass stage.
Our lowpass is done before quantization, otherwise it's hard to have a transition band...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.