Audio and Sound

Digital Audio Basics


Audio Source Frequencies Popular Sampling Rates
Tones, Buzzers Usually a sinusoid of single frequency within the 3 KHz range 2-4 times the tone with the largest frequency
DTMF A weighted sum of two sinusoids at specific standard frequencies between 500 Hz and 3 KHz 7.2 KHz or greater
Alarms Usually a time-varying sweep of a range of frequencies Twice the largest frequency
Human Speech/Voice Can be viewed as a weighted sum of signals between 300 Hz to 3.3 KHz. A human voice is capable of generating these frequencies 8 KHz, 11.02 KHz, 16 KHz
Music & Musical Instruments Can be viewed as a weighted sum of signals between 20 Hz to 20 KHz. A human ear can perceive these frequencies. 32 KHz (Good enough for most instruments), 44.1 KHz (CD-quality), 48 KHz (PC soundcards)

Sampling Rate


Sampling Rate is the number of samples of a signal that need to be captured or played back within a second to ensure the signal has been captured intelligently. The sampling rate should satisfy Nyquist criterion to prevent effects of aliasing. Nyquist criterion requires the sampling rate to be greater than twice the highest frequency in the band of interest.

Bit Rate


Bit Rate is the product of Number of bits used to record a given sample and the sampling rate. It is expressed in kilo bits per second (KBPS).

Audio Quality, Software Codecs and Low-Bit Rate Coding


Audio quality is directly proportional to the Bit Rate. However, since it can take significant memory to record an audio signal in its original form or alternatively significant time to transmit an audio signal in its original form, several software codecs such as ADPCM, G.711, G.726A & Speex have been devised to compress the raw audio signal without in many cases affecting audio quality. Here’s a simple comparison:

  • One second of a speech signal recorded at 16-bit resolution at 8 KHz sampling rate requires about 128 Kilo bits or 16 KB of memory for storage.
  • One second of the speech signal recorded at 16-bit resolution at 8 KHz sampling rate and encoded using the Speex library for dsPIC DSCs will require 8 Kilobits or 1 KB for storage, providing a 16:1 compression.

See the Playback and Recording sections for further details on various algorithms and on-chip peripherals used in audio applications.