Representing sound

About representing sound

The sound that we hear is analogue. In order to record it on a computer it must be converted from analogue to digital so it can be stored in binary. Then if we want to play it through speakers it must be converted back to analogue.

Sampling sound

In order to sample the analogue signal, the sound wave is sampled and its amplitude is recorded at regular intervals.

The sample rate is the number of times per second that a sound is sampled. It is measured in hertz(Hz) with 1 Hz meaning 1 sample per second.

As you can see above, the more frequently the sound is sampled the more closely it represents the original analogue sound. This results in higher quality sound. However, it also means storing more samples so will result in a larger filesize. It may surprise you to know that analogue sounds are commonly recorded at 44100 Hz or 44.1 kHz.

The sample resolution is the number of bits used to record the height of the wave. This affects the number of different heights that the wave can be recorded at. The more heights there are, the more accurately the analogue wave will be represented. This will increase the quality of the sound recording. However, increasing the number of bits used to record the height means more bits are used to store each sample. This means the filesize of the sound will increase. It is common for analogue sounds to be recorded at 16 or 24 bits.

Calculating the size of sound files

The formula to calculate the size of a sound file is:
Filesize = Length in seconds x Sample rate x Sample resolution
This means a 5 second clip with a sample rate of 10 and sample resolution of 8 would be 5 x 10 x 8 = 400 bits.

If it needs to be in bytes then that is 400/8 = 50 bytes.

Knowledge check


Questions:
Correct:

Question text


© All materials created by and copyright S.Goff