Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: -k? (full bandwidth) (Read 14598 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

-k? (full bandwidth)

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...

-k? (full bandwidth)

Reply #1
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.

-k? (full bandwidth)

Reply #2
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

-k? (full bandwidth)

Reply #3
That's not true; assuming 44.1kHz input, -k would come closer to encoding all 22.05kHz of the input file's frequencies.

-k? (full bandwidth)

Reply #4
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.

-k? (full bandwidth)

Reply #5
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.
Vorbis-q0-lowpass99
lame3.93.1-q5-V9-k-nspsytune

-k? (full bandwidth)

Reply #6
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.

-k? (full bandwidth)

Reply #7
You could use it if using 640kbps freeformat, maybe.


-k? (full bandwidth)

Reply #9
One of the purposes of low-pass filtering in audio is anti-aliasing.

-k? (full bandwidth)

Reply #10
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]

-k? (full bandwidth)

Reply #11
[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.

-k? (full bandwidth)

Reply #12
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.

-k? (full bandwidth)

Reply #13
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.

-k? (full bandwidth)

Reply #14
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.

-k? (full bandwidth)

Reply #15
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".

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.

The filter must surely mangle the signal a bit?


Not meaningfully.

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.

-k? (full bandwidth)

Reply #16
How about when you are transcoding from a compressed file that has already been low passed at a lower level than Lame uses?

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.

-k? (full bandwidth)

Reply #17
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.


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.


-k? (full bandwidth)

Reply #19
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.

-k? (full bandwidth)

Reply #20
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...

-k? (full bandwidth)

Reply #21
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.

-k? (full bandwidth)

Reply #22
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.

-k? (full bandwidth)

Reply #23
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.

-k? (full bandwidth)

Reply #24
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?