Binary Representation of Sound
Learning Objectives:
Suggested time: 50 mins
Curriculum Mapping:
- Explain how sound can be sampled and stored in digital form
- Explain how sampling intervals and other considerations affect the size of a sound file and the quality of its playback
Suggested time: 50 mins
Curriculum Mapping:
KS3:
- Understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits
COMPUTER SCIENCE EDUCATORS:
1a: Demonstrate knowledge of and proficiency in data representation and abstraction
- Effectively use primitive data types
- Demonstrate an understanding of static and dynamic data structures
- Effectively use, manipulate and explain various external data stores: various types (text, images, sound, etc.), various locations (local, server, cloud), etc.
- Effectively use modeling and simulation to solve real-world problems
CSTA K–12 CS Standards:
- 2-DA-07: Represent data using multiple encoding schemes.
- 3A-DA-09: Translate between different bit representations of real-world phenomena, such as characters, numbers, and images.
Starter:
Start 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 (See below). After playing the two samples, ask the students what they notice about the two tracks.
(Source: PWNICT: (http://www.pwnict.co.uk/computingGCSE/computingResources.html)
Theory:
Next, explain that, in the previous lessons, the students looked at how numbers and pictures etc. are stored in a computer using binary and that in this lesson they will explore how a computer stores sound.
Explain that sound travels as a wave and show students the following example:
Start 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 (See below). After playing the two samples, ask the students what they notice about the two tracks.
(Source: PWNICT: (http://www.pwnict.co.uk/computingGCSE/computingResources.html)
Theory:
Next, explain that, in the previous lessons, the students looked at how numbers and pictures etc. are stored in a computer using binary and that in this lesson they will explore how a computer stores sound.
Explain that sound travels as a wave and show students the following example:
Next, explain that amplitude controls how loud the sound is and the frequency controls the pitch. Display the following example on the board:
Explain 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).
Describe how the ADC works by taking samples of the sound wave at regular intervals and display the following diagram:
Describe how the ADC works by taking samples of the sound wave at regular intervals and display the following diagram:
Next, explain how the quality and size of the file is affected by two factors - sample rate and bit rate.
Explain 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.
Also explain 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.
Explain 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.
Also explain 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, play the two samples from the beginning of the lesson and ask the students if they can identify which one was converted using the lower sampling rate.
Main:
Give students the following spreadsheet. Instruct students to fill in the following samples and map out the sound wave:
Main:
Give students the following spreadsheet. Instruct students to fill in the following samples and map out the sound wave:
sound_sampling_task.xlsx |
Samples:
Alternative:
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.
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.
Useful Resources:
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.
Frequently Asked Question
Q1: What is binary representation of sound?
Q2: How is sound converted to binary?
Q3: What is sampling rate?
Q4: Why is binary representation important?
- A1: Sound is converted into a series of binary numbers (0s and 1s) that computers can process and store.
Q2: How is sound converted to binary?
- A2: Sound waves are sampled at regular intervals, and each sample is assigned a binary value based on its amplitude.
Q3: What is sampling rate?
- A3: The number of samples taken per second, measured in Hertz (Hz). Higher rates capture more detail.
Q4: Why is binary representation important?
- A4: It allows digital devices to store, manipulate, and transmit sound efficiently and accurately.
Tags: Binary Representation, Binary Representation of Sound, Sound, MP3, WMV, WAV, encoding, Amplitude, Frequency, Pitch, Sample rate, Tags: GCSE, KS4, Theory, Computing Theory, CS Theory, Binary, Binary Representation, binary 2, binary conversion, how to do binary conversion, counting binary, binary number to decimal, binary 101, 8 binary, binary digits, binary digit, meaning of binary