0% found this document useful (0 votes)
91 views28 pages

1.3 Data Storage - Part 3

This document discusses how digital sound is represented and stored on computers. It explains that analogue sound waves must first be converted to digital format through sampling and assigning binary values. Higher sample rates and bit depths allow for better quality recordings but result in larger file sizes. Common file formats like MP3 and WAV are discussed along with lossy and lossless compression methods to reduce file sizes. Students are asked to research other file types that use these compression techniques for images and sound.

Uploaded by

happyproof
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views28 pages

1.3 Data Storage - Part 3

This document discusses how digital sound is represented and stored on computers. It explains that analogue sound waves must first be converted to digital format through sampling and assigning binary values. Higher sample rates and bit depths allow for better quality recordings but result in larger file sizes. Common file formats like MP3 and WAV are discussed along with lossy and lossless compression methods to reduce file sizes. Students are asked to research other file types that use these compression techniques for images and sound.

Uploaded by

happyproof
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Computer Science

Unit 1 - 1.3 - Data Representation - Digital Sound


Starter Activity:

● Convert the following binary number to denary - 0011011


● Add the following binary numbers together - 0010101 +
0000111
● Put the following data units into the correct order starting from
the smallest:
Bytes(B) MegaBytes(MB) Bits(b) GigaBytes(GB)
KiloBytes(KB)

● Complete the following definition:

The bit depth of an image is the number of bits


stored in each pixel
Today’s Lesson
Learning Outcomes:

● Explain how sound is stored in binary form (1)


● Recognise the limitations of different methods for
converting sound into digital form(2)
In addition to text and images, computers may
also be required to store other file formats
including sound and video
● We hear sounds in the form of
How do we hear sound? ANALOGUE SOUNDWAVES
● Computers are unable to ‘hear’ or
process analogue sound and therefore
must convert it into a digital form
● Computers capture analogue
soundwaves using a microphone
● The captured analogue wave is
then converted to a digital format
Analogue to Digital Converter using an ADC
Sampling
● The computer takes a ‘snapshot’ of the original soundwave and
records it as a binary value. This is known as SAMPLING

● Multiple ‘snapshots’ or SAMPLES are taken every second.

● The number of samples taken every second is known as the SAMPLE


RATE - measured in Hertz

● The more SAMPLES that are taken each second, the more of the
original soundwave that is recorded.

● The information is stored as a binary number. The more bits available


for each sample, the more detailed the recording - This is the BIT
DEPTH.
Let’s consider an analogue sound wave…...
44,100kH v 8,000kH
Sound quality is
much better on a
CD over a
telephone. This
is mainly due to
the reduced
sample rate and
lower bit depth.
Bit Depth =
4 bits
(Allows for
16 different
levels or
sounds to
be
recorded)
In real terms…...
How many samples per second do you think are used for an average CD
recording?

44,100Hz 16 bits per


sample
How many samples per second do you think are used by the ADC in your mobile
phone?

8,000Hz 8 bits per


sample
So what does this all mean?
● The higher the sample
rate, the better the
Sound quality is affected by: quality of recording.
● Sample Rate - The number
of samples taken per
second.
● The bit depth - the detail ● The higher the bit
that can be recorded by depth, the better the
each sample.
quality of recording.
Calculating Bitrate

Bitrate = Sample Rate x Bit Depth

1. Mr Hill’s new rap track has been recorded using a sample rate of
20,000Hz with a bit depth of 8 bits. What would the bitrate be?
160,000 bits per second
2. What would the file size be of a 30 second track, recorded at 44,100Hz,
with a bit depth of 16? Give your answer in MB.
30 x 44,100 x 16 = 21,168,000 bits
Two main reasons….
If higher sample rates
● Most humans are
and higher bit depths unable to hear above
mean better quality, 20,000Hz
then why not record ● The file size increases
everything at as the bitrate
increases
100,000Hz with a bit
depth of 24bits?
Compromise between quality
and file size
Listen to the
example and
notice how the
sample rate
affects the quality
of the track.
Ghost in the Machine
http://www.rigb.org/christmaslectures08/
Formats
Mr Hill is looking to record some
tracks for use on the Internet. He Music is stored in a variety of
plans to allow people to formats. Each format has its
download them in order to own advantages and
promote his new music.
disadvantages.
1. Would you recommend Type Characteristics
recording at 44,1000Hz or WAV High quality, Large
20,000Hz? (1) Size
2. What might be a MP3 Good quality, reduced
disadvantage to your size
suggestion? (1) MIDI Basic sound, small size
MIDI Sound Files
MIDI stands for:
MIDI files are sound files, however they are very
different to traditional sound files in that they do
Musical not store any actual sounds - as a result the files
Instrument are usually very small!
Digital
Interface Rather than storing data for actual sounds, MIDI
files store instructions for how sound should be
played. These sounds can then be played by real
MIDI instruments or through a speaker interface.

The instructions in a MIDI file can include the following:


● The pitch of the note to be played
● When each note should start and stop playing
● The duration of a note
● The volume of a note
● The tempo of the music
● The type of instrument that should play each note.
Videos
A common file type for video
● Videos are stored as a files is MP4.
sequence of still FACT - Although similar in
images, displayed one name, MP3 and MP4 are very
after another. different and were not
● The sound/audio track created by the same
is processed organisation
separately but is stored
within the same file.
1. Mr Hill has an image that is 600
pixels by 400 pixels. The image
has a colour depth of 16 colours.
What is the approximate file size?
(Not including Metadata)

2. Mr Hill has an image that is 400


pixels by 200 pixels. The image
has a colour depth of 64 colours.
What is the approximate file size?
(Not including Metadata)

3. Mr Hill has recorded a song that is


4 minutes long. He has used a
sample rate of 20,000Hz and a bit
depth of 16 bits. What is the file
size in MegaBytes?
COMPRESSION

These files can often be extremely large. Simply put, compression is


The disadvantages of this are: "the process of making files
● Large files require large amounts of smaller."
computer memory to open/run
which can slow the computer down.
There are many different
● Large files require more storage
methods of compression,
space - Think about how many
songs can be stored on a CD using different algorithms but
● Large files are slow to send via they all fall into two main
email or to upload/download types - Lossy and Lossless
Two main types of compression

Lossy
● Produces a larger reduction in
file size but achieves this by
removing parts of the file that the Lossless
algorithm considers
unnecessary. ● Reduces the size of the file by
● Lower quality image or sound. storing the data in a different,
● Images may become blurred or more efficient way.
more blocky in colour. ● Reduces the size of the file less
● Sounds may lose some of the than lossy.
high/low pitch sounds that ● Perfect lossless compression is
humans struggle to hear. hard to achieve.
Compressing Images
We already know that bitmap files are large because of?…..
the information being stored about colour in each pixel.

We can reduce the size of the file by reducing:

● The number of pixels in the image. Fewer pixels would mean less
data being stored, and therefore a smaller file size. But what
would be the consequence of fewer (and larger) pixels making up
an image?
● Reduce the number of bits per pixel - But what would this do?

This reduction in quality would make this method a LOSSY method of


compression. Some of the original data is removed in order to reduce the file size
However….could we store the image data more
efficiently? …..Look for patterns
0 0 0 1 0 0 0 0

0 0 1 0 1 0 0 0

0 1 0 0 0 1 0 0

1 1 1 1 1 1 1 0

0 0 0 1 0 0 0 0

0 0 0 1 0 0 0 0

0 0 0 1 0 0 0 0

0 0 0 1 0 0 0 0
Compressing Sound
● Sound can be compressed in a very similar way to images.

● We can lower the sample rate - The number of samples per second

● We can reduce the bit depth - The number bits used to store each
sample

● Both of these methods will result in a reduction in quality.


Homework Task

Use the Internet to find out some common file types


which use lossy and lossless compression for both
images or sound. (Essential knowledge). You should try
to find at least three for each type.

Try typing “gcse 2.6 compression” into YouTube for a


starting point or “lossy v lossless compression" to support
your understanding.

You might also like