lordmulder / LameXP

Audio Encoder Front-End
http://lordmulder.github.io/LameXP
Other
184 stars 18 forks source link

mp3 Sample Rate Problem (VBR Q8 - 44kHz) #48

Closed foggyxp closed 7 years ago

foggyxp commented 7 years ago

LameXP version 4.14 Final-1, Build 1934 Windows 7 64bit Prof Original mp3-File is: 128kbps 44,1kHz STEREO, File Size: 2'947'030 Bytes


Setting in LameXP: -- Compression: VBR, Quality Level 8 a) -- Advanced Options: Sampling Rate Hz 48.000 / MP3 Channel Mode: Mono a) The Output is: Sampling Rate Hz 48.000 mono File Size: 943'104 Bytes

Setting in LameXP: -- Compression: VBR, Quality Level 8 b) -- Advanced Options: Sampling Rate Hz 44.100 / MP3 Channel Mode: Mono b) The Output is: Sampling Rate Hz 24.000 mono File Size: 942'312 Bytes

Setting in LameXP: -- Compression: VBR, Quality Level 8 c) -- Advanced Options: Sampling Rate Hz 32.000 / MP3 Channel Mode: Mono c) The Output is: Sampling Rate Hz 32.000 mono File Size: 825'984 Bytes

Setting in LameXP: -- Compression: VBR, Quality Level 8 d) -- Advanced Options: Sampling Rate Hz 24.000 / MP3 Channel Mode: Mono d) The Output is: Sampling Rate Hz 24.000 mono File Size: 709'800 Bytes

Question: What happens here? Why is the Output in b) only 24 kHz instead of 44 kHz? (Setting 44 kHz!) Why is the Output in d) also 24 kHz (Setting only 24 kHz!) but the filesize is much smaller? Why is with this Setting (Compression: VBR, Quality Level 8) no Output with 44 kHz possible?

Thank you for any good explanation (I am not an expert..)

foggyxp commented 7 years ago

the older version LameXP version 4.12 Build 1818 (with the same setting, see above) does not reduce the original Sampling Rate of 44 kHz to 24 kHz in the output.

lordmulder commented 7 years ago

The LAME mp3 encoder automatically reduces the sampling rate at those ultra-low bitrates. Reduicng the sampling rate effectively works like a "low-pass" filter, according to Nyquists-Shannon Theorem, i.e. it means that the highest frequencies are "discarded". The LAME developers have heavily tuned their Psy models and, obviously, at those ultra-low bitrates, down-sampling to 24 kHz is the better trade-off - compared to the compression artifacts that you'd get when trying to retain the "full" 44.1 kHz frequency range. You can also think of it like that: In this situation (extremely low-bitrate) the down-sampling is the lesser of two evils.

You can avoid the down-sampling that normally happens at ultra-low bitrates by "overruling" LAME's default behavior. This can be done by explicitly setting a target sampling rate via --resample option of LAME. And this is exactly what happens when you set the "Sampling Rate" option in the LameXP front-end to something other than "Auto Select". It's probably not a good idea to "enforce" 44.1 kHz at those ultra-low bitrates though! The LAME engineers probably knew why they implemented auto down-sampling :smirk:

See also: https://hydrogenaud.io/index.php/topic,53573.0.html