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: Does LAME waste bandwidth on nothing? (Read 4367 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Does LAME waste bandwidth on nothing?

I have a couple of audio files that for several reasons have been lowpassed already to 16kHz (never been encoded with a lossy codec besides this mangling). A quick read through some material here on HA and the LAME source (3.93.1 - I lost my 3.90.1 source) reveals that --alt-preset standard sets the lowpass to 19kHz.
Quote
//From presets.c - LAME 3.93.1
case STANDARD: {
                .....
                lame_set_lowpassfreq(gfp, 19000);
                .....
                return preset;
           }

My question is whether manually setting the lowpass cutoff lower (using --lowpass 16) would increase the amount of bits available to frequencies that haven't been thrown away already and hence improve quality.

I fear that this question is demonstrating my profound ignorance of the way MP3 encoding works, but I decided to ask it anyways. Also - I searched and didn't find anything that covers this - I would appreciate a pointer to any thread where this question has been asked before.

Does LAME waste bandwidth on nothing?

Reply #1
can't encode what doesn't exist. don't worry so much.

Does LAME waste bandwidth on nothing?

Reply #2
Quote
My question is whether manually setting the lowpass cutoff lower (using --lowpass 16) would increase the amount of bits available to frequencies that haven't been thrown away already and hence improve quality.
Nope, not with vbr (--alt-preset standard). But with cbr/abr, yes.
Juha Laaksonheimo

Does LAME waste bandwidth on nothing?

Reply #3
It's an interesting question IMO, so I did a quick test:

1. To find out what lowpass to use, I created two mp3s from a randomly chosen .wav file, one --alt-preset standard, the other --alt-preset standard --lowpass 16. Then I used CEP's spectral analysis to find the point where lowpass started. It was not totaly clear, but it started for sure somewhere higher than 15750 Hz.

2. I created 5 test .wav files randomly chosen from my collection like this: CD -> extracted with EAC -> .wav -> lowpassed with CEP's fft filter; settings: 0-15000 Hz: 100%, 15750-22050Hz: 0%.

3. I encoded the .wav files 2 times with lame 3.90.3:
--alt-preset standard and
--alt-preset standard --lowpass 16

4. I compared the sizes of the resulting files (total size of all files):
--alt-preset standard:
30,013,297 Bytes
--alt-preset standard --lowpass 16:
30,008,365 Bytes

Result: --alt-preset standard is 0.016 % bigger
Let's suppose that rain washes out a picnic. Who is feeling negative? The rain? Or YOU? What's causing the negative feeling? The rain or your reaction? - Anthony De Mello

Does LAME waste bandwidth on nothing?

Reply #4
Quote
Then I used CEP's spectral analysis

This completely off-topic, but what is CEP? I'm looking desperately for a small program that can do spectral analysis.
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'

Does LAME waste bandwidth on nothing?

Reply #5
Cool Edit Pro.
Stay sane, exile.

Does LAME waste bandwidth on nothing?

Reply #6
Quote
My question is whether manually setting the lowpass cutoff lower (using --lowpass 16) would increase the amount of bits available to frequencies that haven't been thrown away already and hence improve quality.


In your situation, it would not change very much. Lame only makes a decision regarding the number of bits to use based on the actual content. So if your file is lowpassed, it won't use bits to encode upper 0 samples.

 

Does LAME waste bandwidth on nothing?

Reply #7
Quote
Quote
Then I used CEP's spectral analysis

This completely off-topic, but what is CEP? I'm looking desperately for a small program that can do spectral analysis.

Cool Edit Pro costs a good bit of money, IIRC.  Don't know if there's a demo version available to try out.

If all you need is a simple spectral view of WAV files, though, Exact Audio Copy can do that.  In EAC press Ctrl-E, select a WAV, then after it loads, select menu item Display - Spectral View.