Sampling

To be stored on any digital device such as a computer, compact disk or MP3-player, audio signals need to be converted from analog to digital. This process is called sampling. A sample is a measurement of the signal at a given moment.

The sampling process is characterized by two parameters:

  • sampling frequency: the number of samples that are taken
  • sample quantizion: the number of bits(bytes) we take per sample

Audio sampling frequencies vary from 8kHz for telephony to 48kHz for Digital Audio Tapes.

The by far most common sample quantization is 2 bytes (or 16 bit).

Sampling frequency and resolution together determine how much space your digital audio will take on a storage device. E.g. for a .wav file a sampling rate of 11.025kHz and a resolution of 16 bit/sample is common, resulting in 176.4 kbit/sec or 22.05 kbytes/sec of data. Compact disks that have a sampling rate of 48kHz need 96kbytes/sec.

Nyquist Sampling Theorem

The Nyquist sampling theorem states that the highest frequency that can be represented (without introducing confusion) in a digital signal is half the sampling rate. Therefore, before digitizing, analog signals are first bandpass filtered to have a bandwidth that is no larger than sampling_frequency/2.

Example bandwidth, sample rates and resolutions for common digital media

 

Audio & Speech Compression

In practice the audio signal can be heavily compressed with often minor or even barely audible degradation. These techniques are much more powerful than just reducing sampling rate and/or resolution which would only be a very naive way of compression.

Audio compression relies on properities of the human auditory system. The MP3 standard developed in the 1980's allows to compress HIFI quality sounds with a factor of 10 or more and has been at the basis of all portable audio players of the last decennium.

Speech compression is possible to significantly lower bit rates by building on a model of speech production. The best known example is of course the speech codec used in the GSM system.

 

Audio Demonstrations

Sample Resolution

The demo below contains a sample of a male voice originally sampled at 8kHz with 16 bit samples. Afterwards the file size is reduced by using different different quantizations with lower resolutions.

resolution comment
16 bit linear (original)  
8 bit mu-law (nonlinear) this is the digital telephony standard

8 bit linear

 
4 bit linear  

 

Bandwidth & Sampling Rate

This demo contains a fragment of "Carmina Burana". Being a complex orchestral work with many instruments playing simultaneously it is a prototypical example of an audio fragment that does not allow for much bandwith reduction before starting to sound very horrible. A sample resolution of 16 was retained throughout. This also illustrates why you shouldn't play nice music as a welcome message on your digital answering machine.

sampling frequency
44.1 kHz (original, CD)
22.05 kHz (Hi Quality PC)
11.025 kHz (Voice Quality PC)
8kHz (Telephone Bandwidth)