Why do mp3 have sample rate?


So my understanding of mp3 or any lossy file format is that a lossless audio such as wav will be sampled at some rate i.e. 44.1kHz and the mp3 will compress each second of that to a constant rate of say 192kbps... Now why is there a reason to have a constant bitrate AND still a sample rate of the mp3 file?

What does sample rate of mp3 (lossy) file mean??



Posted 2014-11-25T03:29:59.037

Reputation: 103

TL;DR: bitrare and sample rate describe two separate things. – None – 2014-12-02T01:34:02.050



A sample rate is the rate at which samples are taking from the source sound. It says nothing about how much information is stored in those samples. Whether an audio codec is considered lossy or lossless is dependant on how much information is carried over from the original recorded medium usually (for the sake of argument) based on the 1,412 kbit/s bitrate at 44.1kHz sampling rate which is considered to be uncompressed (CD quality).

Basically the sample rate it is the rate at which the original sound is sampled. MP3 does support low sample rates of down to 16kHz, but these are not very common, as frequencies around 8kHz will not reproduce well.

That's the sample rate. The bit rate is the amount of information that is conveyed at each sample. If you lower the bit rate you effectively lower the resolution of the sampling itself, which will lead to oddities in the audio even when using sample rates of 44.1kHz.

Strictly the resolution refers more to the amount of bytes required to encode each sample, which is why I used the word "effectively" since it sounds like a course representation of your music; whereas in fact MP3 encoding has access to the same sample resolution; however it removes a whole load of information.

44.1kHz is almost always used, however when you drop the bit rate, you generally hear some quite unpleasant side effects in the music. For example, uncompressed audio as stored on an audio-CD has a bit rate of 1,411.2 kbit/s, whereas 128kbit/s MP3 is quite heavily compressed, and even on cheap headphones you can tell the unpleasant differences on any track with more than voices.

David Boshton

Posted 2014-11-25T03:29:59.037

Reputation: 485

Ehh, never mind, I guess maybe it is small enough not to care. It would probably be a bit better to clarify it's the average amount needed for each sample, but it's close enough to still get a +1 from me. Thanks for making the adjustments. – AJ Henderson – 2014-11-25T16:40:27.710

Does the "average" amount needed refer to variable bit rate codecs? For cda, it should be the case that you have the same word length for each sample and therefore a constant byte output for each sample, which implies that for cda, the rate is exactly calculable from the word length for each sample and the sample rate, no averaging required. Genuinely seeking clarification -- I'll edit as I agree it's not as clear as it should be given the number and style of all codec around. – David Boshton – 2014-11-26T10:45:55.563

you know, that's a good question. I was under the impression that CBR didn't go down all the way to the per sample level since I was under the impression that the encoding is more complex than working with just samples, but I don't know MP3 nearly as well as I know the video formats, so I'd have to double check the exact specifics. – AJ Henderson – 2014-11-26T14:26:47.727

Ok, having done some more reading to confirm, I'm pretty sure my initial argument can stand. MP3 works with frequency bins for quantization and so would impact the amount of data used in the storage of each sample slightly. Practically, it is going to probably be pretty close to the same, but also practically, the effective quality loss on each sample will not be the same since quantization error will differ, potentially greatly, from one sample to another. So, really, one could argue the amount stored "per sample" is really kind of irrelevant to the sound quality anyway. – AJ Henderson – 2014-11-26T14:40:44.630

1ArsTechnica had a pretty good write up on MP3 if you were interested. – AJ Henderson – 2014-11-26T14:42:00.560


Your understanding of lossy compression is close, but a little bit off. An MP3 (or any lossy compression) doesn't actually reduce the number of samples per second, but rather, it alters the values of those samples.

Lossy and lossless in terms of compression refers to the ability of the compression to reproduce the input to the compression algorithm exactly when the data is later decompressed.

Lets say I have a sample with values:


For a lossless compression, I need to record each value exactly because there is data that breaks from an easily describable pattern. If, however, I use lossy compression, the compression can say "hey, that looks a lot like counting from 1 to 10, so instead I'm just going to store:


Lossy compression looks for patterns in the sampled content and "fudges" it where it doesn't fit. (In the example above, the second 4 became a 5, because it made the samples easier to describe as a pattern.) This results in the data being able to be compressed more efficiently since compression efficiency depends on patterns in data. The amount of fudging is based on the level of compression trying to be achieved. Higher bit rates result in less fudging and the sample values on output from the MP3 are closer to the values that went in. Lower bit rates result in output that doesn't match as closely, but it still produces a value 44.1k times per second.

AJ Henderson

Posted 2014-11-25T03:29:59.037

Reputation: 7 961