Sound Data Representation

We're now going to learn how computers represent sound and how come sometimes it sounds better and other times it doesn't.

To start with, let's listen to two files...

You might need headphones for this activity to work really well. Or a quiet room :-)

Here is example A - https://drive.google.com/file/d/1tYAe_cHTHFoybbYT-19c9MzodFWlfS3h/view?usp=sharing

Here is example B - https://drive.google.com/file/d/1tcXCOxbiYKalldJLH2STJtCzKYXMjWMh/view?usp=sharing

If the links above do not work, you can find it in the folder on Secka called Digital Technology SECKA > Misc Resources (Sound links are a bit difficult to embed sorry!

Was there a difference between Example A and Example B?

Example A should've sounded way better. Example A is encoded with what is called a 44.1 kHz sample rate, whereas Example B was encoded with a 8 kHz sample rate. (we explain what that means later)

To start with, we need to understand a bit of basic physics. Just what is a sound wave? why can some of us hear things when there are things to hear? Do we all hear the same thing?

We gave you a bit of a clue in the question. Sound is represented to our ears in what is called "waves"

The sounds travel into our ears, and those of us that can hear have what is called an eardrum. The eardrum passes these vibrations through to the inner ear and through to the brain to process. (This is a super simplified explanation... I'll leave you to find all the rest of the detail!)

So now we know that there are waves, and that the shape of the wave makes the sound... we can also figure out a few other simple things.

The two main properties of sound we will look at in this lesson is loudness and pitch. The loudness is controlled by the amplitude of the wave.

So the higher the amplitude (or the bigger the wave) the louder the sound is.

The pitch (or how high or low the sound is - think soprano vs alto) is controlled by the frequency, or how many times a second the wave happens.

So the sound wave on the right is the chipmunk.

These are all pictures of what is called an "Analogue" sound wave. I.e. this is how our ears hear it. This is "perfect".

A computer cannot replicate perfect (although with the speed and power of computers these days, it is better than most humans can hear)

So this is how a computer does it. The sound wave on the left is analogue. At an interval of each second we take a sample. As you can see, when you re-create the sound wave (the green line on the right) it is not going to sound the same, because between each data point, we have no idea what the sound wave is doing.

You can see how the first few data points ended up being "ok" because the points kinda matched what the original wave is doing. But the last few points wouldn't sound right at all, because the wave went up and down and the sample didn't catch that.

This means that the sound loses quality as data has been lost between the time samples. The way to increase the quality and store the sound at a quality closer to the original, is to have more time samples that are closer together. This way, more detail about the sound can be collected, so when it’s converted to digital and back to analogue again it does not lose as much quality.

The frequency at which samples are taken is called the sample rate, and is measured in Hertz (Hz).

1 Hz is one sample per second. Most CD-quality audio is sampled at 44.1 or 48KHz (or 44,100Hz, 48,000 Hz)

So if you scroll up to the examples again, the first example, example A, was "CD quality" but the second one was about a quarter that. That means, that only a quarter of the number of samples were taken at the same time.

Fun fact though, a "voice quality" like a phone call is only required to be about 8khz

Encoding Audio gets super complicated super quickly. For younger kids, you can already extend the binary lessons to show how we can now encode just about anything for a computer - even sound.

For older kids, the GCSE programme from the UK has some good materials that you can work through on your own.

Click here for a link on the BBC's website which takes you through the revision and then a pop quiz