Académique Documents
Professionnel Documents
Culture Documents
Encoding sound
in
sa
us
H
q a
ht
us
-M
M
in
will have to be quantised to the nearest binary code in the digital representation.
sa
It's important to appreciate that sound such as speech or music varies rapidly with
time, and so samples of it will have to be taken at very closely spaced intervals if
us
the digital representation is to be faithful to the original.
Before I can talk about how closely the samples must be spaced, I need to
H
introduce the idea of the frequency of sound. A sound of high frequency is one
that people hear as a high-pitched sound; a sound of low frequency is one that
q
people hear as one of low-pitched sound. Sound consists of air vibrations, and it is
a
the rate at which the air vibrates that determines the frequency: a higher vibration
ht
rate is a higher frequency. So if the air vibrates at, say, 100 cycles per second then
the frequency of the sound is said to be 100 cycles per second. The unit of 1 cycle
us
per second is given the name hertz, abbreviated to Hz. Hence a frequency of 100
cycles per second is normally referred to as a frequency of 100 Hz.
-M
So how often the sound must be sampled? There is a rule called the sampling
theorem which says that if the frequencies in the sound range from 0 to B Hz then,
M
(Self assessment)
1. Five minutes of music is sampled at 40 000 samples per second, and each sample is encoded into 16 bits (2
bytes). How big will the resulting music file be?
2. Five minutes of speech is sampled at 8000 samples per second, and each sample is encoded into 16 bits (2
bytes). How big will the resulting speech file be?
Answer
1. 5 minutes = 300 seconds. So there are 300 40 000 samples. Each sample occupies 2 bytes, making a file
size of 300 40 000 2 bytes, which is 24 000 000 bytes some 24 megabytes!
2. A sampling rate of 8000 per second will generate a fifth as many samples as a rate of 40 000 per second. So
the speech file will only be 4 800 000 bytes.