[Vorbis] Hz vs bitrate?

Geoff Shang geoff at hitsandpieces.net
Sat Jan 21 17:24:03 PST 2006


James wrote:

> the Vorbis FAQ says:
> "mid to high quality (8kHz-48.0kHz, 16+ bit, polyphonic) audio and music at 
> fixed and variable bitrates from 16 to 128 kbps/channel."

hmmm, I actually think those numbers need to be revised.

> What is the difference between Hz and bitrate?

hmmm.  This is going to take a bit of explaining.  I'm not an expert on the 
technicalities, but I understand it enough to try and describe it.

Hz is probably not a good term to use, but it's become a standard so we 
will.  The true count is samples per second.

To represent a sound, you need to take a snapshot of audio, called a 
sample.  Actually, you need two snapshots or samples before you can do 
anything.  Since sound is a series of vibrations, you need to be able to 
capture both the on and off nature of a given vibration before you can 
reproduce it.

This means that the higher the sound you want to record digitally, the more 
samples you need to take.  8000 samples per second will be able to 
reproduce sounds of up to 4000 vibrations per second, the kind of signal 
you get over a telephone line.  If you want to represent the theoretical 
limit of human hearing, 20000 vibrations per second, you need at least 
40000 samples per second.  This is where the CD standard of 44100 samples 
per second (or Hz) comes from.  Note that I think it's more complicated 
than this, hence the extra 4100 (I'm sure someone else on the list will 
explain this).

It's a bit like frame rate with video.  If you record something at 15 fps, 
movement will look jerkier than movement recorded at 30fps, etc.  Except in 
the case of audio, the lower the rate, the more muffled it will sound.

Bit rate is simply a measure of data, or at least data per second.  With 
uncompressed audio, there is a direct relationship between the sample rate 
and the amount of data it takes to represent that sample rate.  A 44.1kHz 
16-bit stereo signal takes 1411.2 kbps, or approximately 10.4 megs per 
minute to record.  A 44.1kHz 16-bit mono file would take half of this, as 
would a 44.1kHz 8-bit stereo file or a 22.05kHz 16-bit stereo file.  I 
won't get into a discussion of bits per sample, just to say that samples of 
lower bit depth are noisier than samples of higher bit depth.

Now, formats like Ogg Vorbis and MP3 compress audio by making calculated 
guesses about the sounds humans aren't likely to hear.  As part of this 
process, such formats allow us to make some of the decisions by deciding 
how much to throw away, or to put it more simply, how much data to use to 
represent the original sound.  So, using our 44.1kHz stereo sample, We can 
choose to use as little as 48kbps or as much as approx 500kbps to store 
this sound.  At 500kbps, more of the original sound should be present than 
at 48kbps.

This is also why we can go lower with lower sampling rates.  A 44.1kHz mono 
sound or a 22.05kHz stereo sound is less complex than a 44.1kHz stereo 
sound, and is therefore easier to store.

Also note that a file's bit rate is simply an indicater of data size.  You 
can, for example, have a 64kbps 44.1kHz stereo sound, or a 64kbps 22.05kHz 
stereo sound, or a 64kbps 44.1kHz mono sound.  All will take up the same 
amount of disk space.  But the first file will be using less data to 
represent more complex sound than the other two.  So at lower rates, one 
needs to decide whether it's better to have higher complexity sound 
represented more poorly, or lower complexity sound represented more 
accurately.  And of course, when you get lower, you also have to decide 
whether it's better to have say 11.025kHz stereo sound, or 22.05kHz mono 
sound, at a given rate.

ONe more comment about bit rates and sound quality.  Bit rates are, as I've 
said above, merely a measure of quantity of data.  This means that it's 
only at all valid to compare bit rates of a given codec to itself. 
Encoding at 128kbps may be overkill with one codec, and insufficient with 
another.  Especially with MP3, even the sound quality that you'll get at a 
given bit rate will vary from encoder to encoder.  So ultimately, unless 
you need to use a specific data size (e.g. for streaming), the best measure 
of how good something sounds is to listen to it and see.

> Doesn't MP3 support higher bitrates?

Yes, and so does Ogg Vorbis.  Quality 10 in the Xiph encoder aims at approx 
500kbps for a 44.1kHz stereo sound.  I've only ever seen MP3 go to 320kbps, 
but there may be encoders which go higher.  But it's all a matter of how 
much data you want to represent a sound - you could write an encoder which 
uses 4 times the uncompressed bit rate for storage, but there wouldn't be 
much point.  It's only an indicator of how much data is being used to store 
the sound.

Geoff.



More information about the Vorbis mailing list