Help - Search - Members - Calendar
Full Version: Automatic Downsampling in LAME - what to expect
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
servodude
Hi

I've noticed when encoding at very low bit rates in lame that the sample rate specified seems to make little difference to the bandwidth of the result.

e.g encoding to 32kbps CBR mono
selecting 22.05 and 44.1kHz both give a maximum encoded frequency of ~8.5kHz

Is this downsampling documented anywhere? so that I might know what to expect.

Sorry if this has been asked before - i had a quick look and saw that downsampling was expected but not exactly what it would sample to.
Any info on the process would be gratefully received .
Thanks

sd
[JAZ]
The bitrate determines how much data will be stored to represent one second of music. Lower bitrate necessarily implies , for the same encoder/codec, less music information, and a lowpass filter is used to limit it, so that the lower frequencies get encoded sufficiently good.

Changing the samplerate changes nothing in this regard. It does affect other parameters, like for example, being an MPEG-1 or MPEG-2 file (44Khz->MPEG-1, 22Khz->MPEG-2).

So, sumarizing... It is not downsampling. It is necesarily filtering sounds that would otherwise make the encoder go mad at trying to encode everything, and you would get a *very* fluctuating quality.

Downsampling is not necessary, but the codec does it to reflect the bandwidth you can expect. The only exception to this is 8, 16, and 24kbps, which cannot be encoded in MPEG-1 (44Khz)
servodude
OK - Thanks Jaz

Basically I have a lot of mono files that need to be encoded at 32kbps and I was trying to come up with an ABX test for the other parameters, and i was surprised when i checked the spectra of the results.

I tried encoding with the -k switch in lame thinking this would remove all filtering - i guess that it didn't.

Is it possible to know in advance what the LPF fc will be before I encode?

Looking at the spectra of the results it seems to be ~8.5k; can this be adjusted?

Given that for these files I am not concerned with the appended/prepended silence would there ever be a case for encoding at 44.1kHz sample rate?

Thanks guys for the help thus far.
Best regards,

sd
[JAZ]
LAME 3.97 (beta 2, Nov 29 2005) 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Autoconverting from stereo to mono. Setting encoding to mono mode.
Resampling: input 44.1 kHz output 22.05 kHz
Using polyphase lowpass filter, transition band: 8269 Hz - 8535 Hz


Note, -k switch works. You have to put it at the end of the parameter lists, before the input filename. Then, it says "polyphase lowpass filter disabled", and you will understand why the encoder does apply a filter.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.