1.2 Memory and Storage

1.2.4 Data storage (Sound) - click to expand

This section covers:

  • How sound can be sampled and stored in digital form

  • The effect of sample rate, duration and bit depth on:

    • The playback quality

    • The size of a sound file

Numbers, Characters, and Images are on the previous pages

🏠 Click here to go back to the main page.

Other sections in this topic:

πŸ”—1.2.1 Primary storage (Memory)

πŸ”—1.2.2 Secondary storage

πŸ”—1.2.3 Units

πŸ”—1.2.5 Compression

On this page, we will look at how a sound can be recorded and converted to a form that a computer system can store.

What is Sound?

Sound is transmitted through the air as changes in air pressure. When an object vibrates it causes vibrations to travel through the air. We have nerves inside our ears that can detect when these changes in air pressure hit out ear drums.

When we want to record sound, we have to convert this difference in air pressure into an electronic signal. To do this, we use a microphone. The microphone has a diaphragm attached to a magnetic coil which produces an electrical signal that gets larger when the sound gets louder.

If we want to store this electrical signal on a computer, we must convert it into a numerical signal. This is called digitising.

This musical instrument has strings which can be made to vibrate. The sound is made louder by the body of the instrument which makes the air vibrate and change in pressure. This is what our ear hears.

How Sound is Sampled

The continuously changing sound signal has to be sampled many thousands of times a second. The microphone produces a signal and an electronic circuit converts the signal to a number at very precise and regular intervals. The amount of signals that are recorded a second is called the sampling frequency and may be as high as 300,000 times a second but can also be as low as 5000 times a second.

To replay the sound, these digital values are used to control the level of an electrical signal that moves a loudspeaker cone at precisely the correct frequency (the sampling frequency). The loudspeaker cone move back and forwards which vibrates the air and causes a sound pressure wave to travel through the air in exactly the same way that the original sound did.

When the signal is converted to a number to be stored in a computer, the number values need to be converted to a binary value. If we use one byte to store each sampled value, then it is possible to store 256 different values. This is known as the bit depth of the sample. An eight bit bit depth will create a reasonable sound quality but when the sound is replayed, it will be obvious that the sound quality is not as good as the original. If we use two bytes instead, the a 16 bit value can store 65536 different values which will produce a much better sound that the human ear will not be able to tell from the original sound.

The Effect of Sampling Frequency and Bit Depth on file size

If we increase the sampling frequency, we will record more values for every second of sound. Doubling the sampling frequency will double the number of values that are stored.

Increasing the bit depth will also increase the amount of data that is stored. If we store 16 bits (2 bytes) for every sample instead of just 8 bits, then this will also double the file size.

Larger file sizes take up more storage space and take longer to transmit over a network, or download via the internet.

Calculating File Size

You may be asked to calculate how large a file will be given its sampling rate and bit depth. This is the formula that you use:

filesize = (sampling frequency * bit depth * length)

The calculated file size will be measured in bytes (because we have divided the answer by 8), the sampling frequency will be in hertz, the bit depth in number of bits and the length will be in seconds.

If we have a twenty second long sound that is recorded at a sampling frequency of 8000 hertz and a 16 bit bit depth, then the calculation looks like this:

filesize = (8000 * 16 * 20) /8

filesize = 2560000 / 8

filesize = 320000 bytes

We usually try to convert this to a value less than 1000, so 320000 bytes is 320 kilobytes.

Your exam question may ask how many sound files bit within a certain space on a storage device. The key to working out the answer is to make sure that the size of file and the size of the storage device are both given using the same unit, i.e megabytes, gigabytes etc.

Quick Test (Requires login)

Other Resources for this topic

Craig and Dave Videos (Requires login)