0% found this document useful (0 votes)
23 views

A-Level Revision Notes - 31B Sound

Uploaded by

Nick Gray
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

A-Level Revision Notes - 31B Sound

Uploaded by

Nick Gray
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Teach Computer Science

A-Level

Sound

teachcomputerscience.com
1.

Revision notes

teachcomputerscience.com
Introduction
Sound is another form of data that is stored on a computer. Similar to
other types of information such as numbers, text, and images, the
sound is also stored in digital form. But, sound, when produced, is in
analogue form, that is, continuous varying data. To store sound in the
computer, it is sampled to obtain thousands of samples per second
where each sample corresponds to a binary value.

Sampling
Sampling is the process that converts analogue sound into discrete
digital data that can be stored in the computer. An analogue sound
signal is represented, as shown in the figure below. This sound is
sampled every two seconds to obtain discrete digital sound.

Figure 1: Sampling of an analogue audio signal

teachcomputerscience.com
We can see that the shape of digital sound is quite similar to analogue
sound, but the curves are not smooth. A listener will feel that it is the
digital sound is the same as the analogue sound, but the quality has
reduced. The audio quality of a digital sound is affected by factors
such as sampling rate, bit depth, and bit rate.

Factor Definition

Sampling rate Number of samples per second

Bit depth Number of bits used to represent each clip

Bit rate Number of bits used per second of audio

Sampling rate
The sampling rate is the number of samples taken per second. The
higher the sampling rate, the higher the sound detail. The ups and
downs of the sound wave can be recorded more clearly. The unit for
sampling rate is also represented in Hertz (Hz). Each sample
represents the amplitude of the wave at a certain point in time. The
following image illustrates the effect of sampling rate on the quality of
the audio wave. The higher the sampling rate, the more similar is the
discrete form to the analogue form and better is the quality.

Figure 2: Sampling rate

teachcomputerscience.com
The most common sampling rate for music is 44,100 samples per
second, which is 44,100 Hz (=44.1 kHz). A voice over Internet protocol
(VOIP) has a sampling rate of 8 kHz, which is enough for the human
voice to be heard clearly, but the quality is reduced to a certain extent.
The number of oscillations per second is called frequency. It is
measured in Hertz (Hz) and controls the pitch of the sound. Sound
waves with different frequencies are given.

Higher Lower
frequency frequency

0.0 0.0 0.0 0.0 0.0


1 2 3 2 4

Nyquist’s theorem states that for accurate sampling, the sampling rate
must be at least twice the frequency of the highest frequency in the
original sound signal. When the sampling rate is less than the
frequency suggested by Nyquist’s theorem, the recording will not be
accurate to the original sound.

teachcomputerscience.com
Bit depth
Bit depth is the number of bits available for each sample. The higher
the bit depth, the higher the quality the audio will be. A CD has a bit
depth of 16 bits, and a DVD has a bit depth of 24 bits. An n bit system
can have 2n different values. Hence, a CD can represent values from 0
to 65535(216 -1).
High-quality audio files are created as pulse-code modulation (PCM).
PCM is the process for digitising a sound file and creating an
uncompressed file. WAV and AIFF are a few examples of
uncompressed audio file formats.

Bit rate
Bit rate is the number of bits of data used to store data sampled every
second. The unit for bit rates is kilobits per second (kbps).
Bit rate=Sampling rate × bit depth × channels
An audio file has 44,100 samples per second, a bit depth of 16-bits and
2 channels (stereo audio). A bit rate of this file can be calculated as:
Bit rate=44100×16×2=1,411,200 bits per second=1411.2 kbps
Reasonable music audio must have a minimum bit rate of 128 kbps.
The higher the bit rate, the better the quality. This is the reason why
the audio quality of a music CD is better than downloading from the
internet.
A three-minute song of audio with bit rate 1411.2 kbps, bit depth 16
bits and 2 channels, has a bit rate of 1411.2 kbps per second.
For 3 minutes, the number of bits required is
1,411,200×180=254,016,000 bits.
This value is equal to 254016000 ÷ 8 = 31752000 bytes = 31.75
megabytes (MB). This is the file size of a three-minute audio song.

teachcomputerscience.com
Musical instrument digital
interface (MIDI)
MIDI is a communication protocol that enables electronic musical
instruments to interact with each other using information and control
signals.
This protocol uses an asynchronous serial 8-bit transmission for
communication. A start and the stop bit is required in the
asynchronous transmission.
MIDI file instructs a device on how to produce a musical note using
several commands. A command is identified by its specific sequence of
bytes. There are two types of MIDI bytes, such as status and data.
Status bytes indicate instruments about the type of action to be
performed. MIDI files operate on 16 channels, and the action for all
these channels are present in the status byte. Some of the actions
instructed are notes on/off, polyphonic key pressure, pitch bend, etc. A
note on/off specifies whether the key is pressed or released in the
instrument. The key pressure indicates how hard a key is pressed and
hence, denotes the loudness of music note.
The data bytes gives information to status byte. Pitch byte denotes the
note to be played. Velocity byte denotes the loudness of the note.
MIDI files are developed when sound from an instrument is recorded.
The extension for MIDI files is .mid. Using a MIDI file, music identical to
original can be played every time. This file also enables us to play the
same music through different instruments. A sequence software is
required so that the commands in MIDI files are recognised.
As these protocols allow the usage of 16 channels, 16 different
instruments can be instructed at the same time. Hence, an electronic
orchestra can be created by giving input to each instrument through a
sequencing software. As a result, MIDI files are widely used in
recording studios, orchestras and musical scores in films.
Compared to an MP3 file, the size of the MIDI file is small. This is
because the MIDI file does not contain any audio track. MIDI files are
used in web pages. Due to its less memory requirement, MIDI files are
also used in mobile phones to store ringtones.

teachcomputerscience.com
Analogue to digital conversion
An analogue signal is a continuous signal which represents physical
measurements. A signal from a microphone is an example of an
analogue signal. Sound signals in analogue form can be recorded on
tape. The signals are amplified and played via a speaker.
Digital signal, however, is a discrete signal that uses discontinuous
values to represent information. For example, information stored on a
compact disc, computer, and digital watch. An analogue signal is
sampled at intervals to convert it to digital values which are then
stored in devices such as compact disc and DVDs.
A microphone converts sound energy to electrical energy. In this
process, sound in analogue form is converted to digital form by
sampling the analogue signal at intervals. The amplitude at the
intervals is measured and converted to binary value based on the bit
depth.

Microphone Amplifier ADC

Binary value

Speaker Amplifier DAC

Digital values are converted to analogue signals by a digital to


analogue converter (DAC). The signal is amplified and sent to a
speaker.

teachcomputerscience.com
2.

Activity

teachcomputerscience.com
Activity-1
Duration: 10 minutes

1. A system has a bit depth of 8 bits. What range of values can it


represent? Show your working.

2. Calculate the bit rate of a 32-bit depth system with a sampling rate
of 44,100 samples per second and 2 channels.

3. What is the file size of a 4-minute song with a bit rate found in
question 2?

4. What happens to the file size and sound quality if the sampling
rate is increased?

teachcomputerscience.com
3.
End of topic
questions

teachcomputerscience.com
End of topic questions
1. How is an analogue sound converted to digital form?
2. How is a sound file downloaded from the internet different from a
sound file in CD?
3. What happens to a sound file if its bit depth is increased?
4. Why is the sampling rate of sound in VoIP just 8 kHz?
5. What are the factors by which the audio quality of a digital sound
is affected?
6. This question is about the waveform given.
Amplitud
e

0.01 0.03 0.04


5 0 5 time
(s)

i. What is the frequency of this signal?


ii. What is the minimum sampling frequency required to
sample this signal so that an accurate recording can be
made?

7. What are the advantages of using a MIDI file? State examples of


data stored about a musical note in a MIDI file.

teachcomputerscience.com

You might also like