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: MP3 Sampling Frequency - am i missing something (Read 4094 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MP3 Sampling Frequency - am i missing something

Hi

I hope this question is not too newbie for you but I am puzzled as to why anyone would choose a lower sampling rate when encoding an MP3 file..? I had assumed that at the same bit rate choosing a lower sampling frequency for encoding would give a smaller file... but it does not appear to work that way.

At the minute I am putting together a library of short audio files (~400ms) for use in a portable device.

They will be concatenated at playback and therefore the less padding at either end the better; I have a choice of a few embedded mp3 decoder shells - not all support gapless - and i am trying to keep this as general as possible at the minute.

In order to fit as many files as possible on to the device i would like to minimise the size of the files.

So i looked at the compression options I had presented to me (using lame and goldwave gw5) and tried a few different sample rates at 32kbps (it's alright it's only speech - through a tiny speaker)

Given that there's pretty much a frame added either end,  a 400ms wav file compressed  at 32kbps ends up twice as large at 8kHz as it does at 44.1kHz and nearly doubles in length due to the padding.

Fair enough I've learnt my lesson and I will use 44.1kHz (smaller file - less silence)
But...
  what's the point of the lower sampling rates?
  can anyone suggest a circumstance where it would be more beneficial to use 16kHz or 8kHz rather than 44.1?
  I would have thought that there was less information required at the lower sampling rate and therefore the the file would be smaller.

Does it give better resolution (smaller frequency bins) up to the chosen nyquist frequency with the cost that the audio ouput has a bit of silence at either end?

It has me puzzling..

Thanks
sd

MP3 Sampling Frequency - am i missing something

Reply #1
If they're less then 1 second long, and you don't support gapless decoding, I'd probably concatinate a few together so they're at least a couple seconds long.

MP3 Sampling Frequency - am i missing something

Reply #2
I had assumed that at the same bit rate choosing a lower sampling frequency for encoding would give a smaller file... but it does not appear to work that way.

Bit rate means "number of bits per second", so if you select a bitrate you are constraining the final file size.

MP3 Sampling Frequency - am i missing something

Reply #3
At the same bit rate (e.g. 32 kbps) the same file should sound better and have less artifacts at the lower sample rate (such as 32 kHz, 16kHz etc.), as long as the resultant loss of high frequencies is not a problem.

The maximum frequency that can be reproduced with, for example, a 16 kHz sample rate is 8 kHz, probably adequate for speech but not very good for music.

If you really want smaller files without losing too much quality then you have to lower both the sample rate and the bit rate.

 

MP3 Sampling Frequency - am i missing something

Reply #4
Thanks folks,

That's pretty much what I had thought but its nice to have it confirmed.

At any given bit rate:
as long the sound has no spectral component above the Nyquist frequency you get better sounding compressed audio with a lower sampling frequency. (eg. 5K BW speech sounds better (in theory) when compressed at 16K than 44K)
But you get slightly longer periods of silence at either end.

Thanks for the suggestions.

I am hoping that i'll have gapless playback (my main contender at the moment does)

I am trying to keep the files as long as possible, in addition to the padding having less effect the fewer files to play in sequence the easier the job is but  and for flexibilty it makes sense for the audio files to be as short as possible e.g <40 files should allow you to compose just about any possible number.

Thanks again
sd