Sampled sound

From Higher Computing Science
Jump to: navigation, search

Key points

  • Sampled sounds are stored by digitising the sound wave recorded by a microphone. The sound wave is sampled thousands of times per second and the values are recorded into a file.
  • The quality of a sound file is determined by how many samples per second are taken, and the sampling depth of each sample (the number of bits used to represent the sample)

Information

File:CPT-Sound-SampleRate-3way-Comparison.png
Comparison of 3 sound samples using 8kHz, 22kHz and 44kHz sample rate. Note the spacing of the data points for each sample

When a sound is recorded into a computer, it must go from analogue waves pulsing through the air to a digital representation.

To record a sound, a conversion must take place. Usually this is using a microphone, a device which converts audio waves to electrical signals. The signals are then measured (sampled) into binary by the computer using an interface called an analogue to digital converter.

Sound quality

The quality of the sound depends on three important measures:

  • How many samples of the sound are taken as it is measured and converted into binary
  • How many bits are used to store each sample
  • Whether the sound file is compressed, which can lead to data loss.

Sampling rate

Sampling rate is the number of times a second that a computer will record the signal level. The higher the sampling rate, the more detail is retained for each second of audio. Audio CDs use a sample rate of 44,000 Hz, whereas recording studios will use 192,000Hz, in order to make effects and changes to recordings effective.

Bit depth

Just as in a bitmap image, the number of bits used for each sample determines the variation in the image. This time, instead of providing the number of colours that can be used, the bit depth represents range of values each sample can hold. The bigger the range, the more detailed the representation of the audio wave can be.

Calculating the size of a sound file

A sound file's size can be calculated by multiplying the bit depth (bits per sample) by the sampling rate (samples in 1 second) by the number of seconds.

Videos

Further information

Test yourself

Teaching resources