Continuing the theme of how data is stored in computers, in this week’s lesson, I focused on how sound is represented in a computer system.
Lesson 1: Theory (Sound)
Suggested time: 50 mins
I started the lesson by playing two samples of the same track (Tenacious D - Tribute “The Best Song In The World”), each compressed at different sample rates, which I downloaded from PWNICT: (http://www.pwnict.co.uk/computingGCSE/computingResources.html) - Click on 2.1.4 representation of data --> Lesson 5 Sound in Binary. You can find a direct link to the two samples below. After playing the two samples, I asked the students what they noticed about the two tracks.
Next I explained that, in the previous lessons, we looked at how numbers and pictures etc. are stored in a computer using binary and that in this lesson we will explore how a computer stores sound.
I explained that sound travels as a wave and showed students the following example.
Next, I explained that amplitude controls how loud the sound is and the frequency controls the pitch. I then displayed the following example on the board:
I followed this by explaining that sound waves are analogue and that, in order to store the waves digitally on the computer, we need to convert the waveform into a numerical representation so that the waveform can be stored in binary. To do this, we use an Analogue-to-Digital Convertor (ADC).
I described how the ADC works by taking samples of the sound wave at regular intervals and displayed the following diagram:
Next, I explained how the quality and size of the file is affected by two factors - sample rate and bit rate.
I explained that the sample rate refers to the number of samples taken every second and that the greater the frequency of the samples, the better the sound quality.
I also explained that the bit rate refers to the number of bits used to store each sample and that the more bits that are sampled, the better the accuracy of the file but also the greater the file size.
Finally, I played the two samples from the beginning of the lesson and asked the students if they could identify which one was converted using the lower sampling rate.
Students were given the following spreadsheet and instructed to fill in the following samples and map out the sound wave:
Alternatively, students could use Audacity (Free) to explore how sound is stored on a computer. Students could be given an .MP3 file which they open in Audacity and zoom in to see the value of each sample. Students could then export the sound file using different sample rates and investigate the effect the sample rate has on sound quality.
Students were instructed to update their class revision wiki.
PWNICT - Excellent PowerPoint presentation from PWNICT – Computing Resources explaining how sound is stored on a computer - Click on 2.1.4 representation of data --> Lesson 5 Sound in Binary
Classzone – Frequency / Amplitude simulator
Binary representation of sound worksheet – Courtesy of Emma Partridge (via CAS). Download the worksheet here: http://community.computingatschool.org.uk/resources/1035
Extract from the CHRISTMAS LECTURES 2008: Chris Bishop - The Ghost in the Machine showing how sound is stored on a computer - Skip to 13:40.
Lesson 2: Python
Suggested time: 50 mins
Students were instructed to setup their Raspberry Pis and to launch IDLE 3.
Students were then asked to continue to work through Mark Clarkson’s Introduction to Python booklet: (http://community.computingatschool.org.uk/resources/14)
Alternatively, if you do not have access to a set of Raspberry Pis, students can still complete the Python challenges:
To install Python for FREE, go to the python.org website and download a standard installation of the latest version of Python. This will provide you with everything you need.
Microsoft Innovative Educator Expert / MIE Trainer
Minecraft Cert. Educator / Global Mentor
CAS Master Teacher
Raspberry Pi Cert. Educator