What is sound?

Sounds are waves of air. We hear sounds because our ears are sensitive to these waves. One of the easiest types of sound wave to understand is a short, sudden sound like a hand clap. When you clap your hands you create a pressurised wave of air which moves at about 340 meters per second ( "the speed of sound" ). When this wave rea­ches your ear, it pushes on your eardrum slightly, causing your ear drum to vibrate and you hear the clap.

waveform_clap.jpg

A hand clap is a short event that causes a single wave of air that quickly dies out. The image above shows the shape of the wave ("waveform") for a typical hand clap. 

Other sound waves are longer events and can be illustrated with the example of a ringing bell. When you ring a bell, after the initial strike, the sound comes from the ongoing "ringing" of the bell. While the bell is still ringing, it vibrates at a particular speed ("frequency") and this causes the nearby air to vibrate at the same speed. This causes waves of air to travel from the bell, again at the speed of sound. Pressure waves from continuous vibration look more like this:

waveform_sine.jpg

Both of these types of waves are called sound waves or acoustic waves.

Digital recording and playback

A microphone consists of a small membrane which vibrates when it meets these acoustic waves. The microphone translates movements of the membrane into electrical signals.  Acoustic waves are translated into electrical waves by the microphone.

If you were to look at the shape of this electrical wave you would see that it looks very similar to the shape of the original sound wave. The following is the sound wave we saw in the above explanation :

waveform_sine.jpg

The following is the electrical wave created by the microphone (notice the measurement for "Current") :

waveform_current.jpg 

You could say that the shape of the electrical wave is analogous to ("similar to") the shape of the original sound wave. This is why these electrical waves that represent sound waves are called analog waves.

The main device used in digital recording is a Analog-to-Digital Converter (ADC). The ADC measures the voltage of an electrical wave thousands of times per second. These measurements are used to create a map of an electrical wave :

waveform_sampled.jpg

Each dot in the figure above represents one audio sample. The more samples per second the more accurate the mapping of the electrical wave.

Playback of digital audio uses a Digital-to-Analog Converter (DAC). This takes the samples and converts them back into an electrical wave.  This electrical wave is output to the sound cards headphone or speakers sockets and is used by speakers to once again recreate the original sound wave.

Your computers soundcard comes with an Analog-to-Digital Converter (ADC) for recording, and a Digital-to-Analog Converter (DAC) for playing audio. Your operating system (Windows, Mac OS X, Linux, etc.) talks to the sound card to actually handle the recording and playback, and audio applications talk to your operating system so that you can play sound files, capture sounds to a file, edit them, and mix multiple tracks while playing etc.

Quality

There are two factors that determine the quality of a digital recording:

  • Sample rate: this is the rate at which the samples are recorded or played back. Sample Rate is measured in Hertz (Hz), or samples per second. An audio CD has a sample rate of 44,100 Hz (often written as "44 KHz" for short). 

  • Sample format or sample size: Essentially this is the number of digits in the digital representation of each sample. Think of the sample rate as the horizontal precision, and the sample format as the vertical precision. An audio CD has a precision of 16 bits.

Higher sampling rates allow a digital recording to accurately record higher frequencies.

Higher sample sizes allow for more dynamic range - better reproduction of  loud and soft sounds.

Audio file formats

There are two main types of audio files on a computer:

  • PCM stands for Pulse Code Modulation. This is just a fancy name for the technique where each number in the digital audio file represents exactly one sample in the waveform. Common examples of PCM files are WAV files, AIFF files, and Sound Designer II files.

  • The other type is of audio file are those that are compressed. Modern compressed audio files use sophisticated psychoacoustic algorithms to represent the essential frequencies of the audio signal in far less space. Examples include MP3 (MPEG I, layer 3), Ogg Vorbis, and WMA (Windows Media Audio). When you create an these types of file, you are deliberately losing some quality in order to use less disk space.