Chapter 6

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 34

CHAPTER 6

B A S I C S O F D I G I TA L A U D I O
DIGITAL AUDIO

Digitizing Sound
• Sound results from the mechanical disturbance of some object in a
physical medium such as air.
• These mechanical disturbance generate vibrations that can be
converted in to an analog signal by means of devices such as
microphone.
• Analog signals are continuous in a sense that they consist of a
continuum of values as opposed to stepwise values.
• Microphone produces analog signal
• Computer deals with digital signal
DIGITAL AUDIO…

Analog Audio
• Most natural phenomena around us are continuous
• Sound is not exception to this rule i.e. sound also constantly
varies.
• Continuously varying signals are represented by analog signal.
• Signal is a continuous function f in the time domain.
• For value y=f(t), the argument t of the function f represents time.
• If we graph f, it is called wave.
DIGITAL AUDIO…

• A wave has three characteristics:


• Amplitude
• Frequency, and
• Wave length

Amplitude: is the intensity of signal.


• This is can be determined by looking at the height of signal.
• If amplitude increases, the sound becomes louder.
• Amplitude measures the how high or low the voltage of the signal is
at a given point of time.
DIGITAL AUDIO…

Frequency: the number of times per second that a sound pressure wave repeats
itself.
• It is measured in Hertz (HZ), KiloHertz (KHZ), MegaHertz (MHZ), etc

• This can be determined by counting the number of cycles in given time


interval.
• Frequency is related with pitchness of the sound(Firikuweensiin sagalee
olka’iinsa sagalee wajjin wal qabata.).
• Increased frequency  high pitch.

Wave length: The minimum distance in which a sound wave repeats itself is
called its wavelength
DIGITAL AUDIO…
DIGITAL AUDIO
• Human can hearing range falls in the range 20Hz–20KHz
• When sound is recorded using microphone, the microphone
changes the sound into analog representation of the sound.
• In computer, we can’t deal with analog things.
• This makes it necessary to change analog audio into digital
audio. How?
ANALOG TO DIGITAL CONVERSION

• Converting an analog audio to digital audio requires that the analog


signal is sampled.
• Sampling is the process of taking periodic measurements of the
continuous signal.
• Samples are taken at regular time interval, i.e. every T microseconds
or milliseconds.
• This is called sampling frequency/sampling rate.
• For audio, typical sampling rates are from 8 kHz (8,000 samples per
second) to 48 kHz.
• Digitized audio is sampled audio.
• The amount of information stored about each sample is referred to as
sample size.
ANALOG TO DIGITAL…
• Analog signal is represented by amplitude and frequency.
• Converting these waves to digital information is referred to as
digitizing.
• Digitization is the process of converting information into a digital
(i.e. computer-readable) format.
• In digital form, the measure of amplitude is represented with binary
numbers.
• The more numbers on the scale the better the quality of the sample,
but more bits will be needed to represent that sample.
• The graph below only shows 3-bits being used for each sample, but
in reality either 8 or 16-bits will be used to create all the levels of
amplitude on a scale.
• Music CDs use 16-bits for each sample.
ANALOG TO DIGITAL…
ANALOG TO DIGITAL…

• In digital form, the measure of frequency is referred to as how


often the sample is taken.
• In the graph above the sample has been taken 7 times (reading
across).
• Frequency is talked about in terms of Kilohertz (KHz).
• Hertz (Hz) = number of cycles per second
• KHz = 1000Hz
• MHz = 1000 KHz

• Music CDs use a frequency of 44.1 KHz.


• A frequency of 22 KHz for example, would mean that the sample
was taken less often.
ANALOG TO DIGITAL…

• Sampling means measuring the value of the signal at a given time


period.
• The samples are then quantized.
Quantization
• It is representation of a large set of elements with a much smaller set.
• Quantization is a matter of representing the amplitude of individual
samples as integers expressed in binary
• A sample’s amplitude must be rounded to the nearest of the allowable
discrete levels
• In speech coding, prior to storage or transmission of a given
parameter, it must be quantized in order to:
• reduce storage space or
• transmission bandwidth
ANALOG TO DIGITAL…

• It is rounding the value of each sample to the nearest amplitude


number in the graph.
• For example, if amplitude of a specific sample is 5.6, this should be
rounded either up to 6 or down to 5.
• This is called quantization.
• Quantization is assigning a value (from a set) to a sample.
• The quantized values are changed to binary pattern which is stored
in computer.
ANALOG TO DIGITAL…

Fig Sampling and quantization


ANALOG TO DIGITAL…
Example:
• The sampling points in the above diagram are A, B, C, D, E, F, H, and I.
• The value of sample at point A falls between 2 and 3, may be 2.6.
• This value should be represented by the nearest number.
• We will round the sample value to 3
• Then this three is converted into binary and stored inside computer.

• Similarly, the values of other sampling points are:


B=1 F=1
C=3 G=2
D=1 H=3
E=3 I=1
• The values of most sample points are quantized.
• After quantization, we convert sample values into binary digits.
SAMPLE RATE

• A sample is a single measurement of amplitude.


• The sampling rate is the number of these measurements taken every
second.
• In order to accurately represent all of the frequencies in a recording
that fall within the range of human perception, we must choose a
sample rate high enough to represent all of these frequencies.
• At first consideration, one might choose a sample rate of 20 KHz
since this is identical to the highest frequency.
• This will not work, however, because every cycle of a waveform has
both a positive and negative amplitude and it is the rate of
alternation between positive and negative amplitudes that
determines frequency.
• Therefore, we need at least two samples for every cycle resulting in
a sample rate of at least 40 KHz.
SAMPLE RATE…
Sampling Theorem
• For a single-frequency sound wave to be correctly digitized, the
sampling rate must be at least twice the frequency of the sound wave.
• More generally, for a sound with multiple frequency components, the
sampling rate must be at least twice the frequency of the highest
frequency component.
• This is known as the Nyquist theorem.
Nyquist’s Theorem:
• Given a sound with maximum frequency component of f Hz, a
sampling rate of at least 2f is required to avoid aliasing. The minimum
acceptable sampling rate (2f in this context) is called the Nyquist
rate. Sample rate = 2 x highest frequency
.
SAMPLE RATE…

• Given a sampling rate of f, the highest-frequency sound


component that can be correctly sampled is f/2. The highest
frequency component that can be correctly sampled is called the
Nyquist frequency.
• When the sampling rate is lower than or equal to the Nyquist
rate, the condition is defined as under sampling.
• It is impossible to rebuild the original signal according to the
sampling theorem when such sampling rate is used.
ALIASING

• What exactly happens to frequencies that lie above the Nyquist


frequency?
• When the sampling rate is too low, the reconstructed sound wave
appears to be lower-frequency than the original sound (or have an
incorrect frequency component, in the case of a complex sound
wave).
• This is a phenomenon called aliasing
• In practice, aliasing is generally not a problem.
• Standard sampling rates in digital audio recording environments
are high enough to capture all frequencies in the human-audible
range.
ALIASING

• For example, consider a signal with a sample frequency of 100 Hz,


and the input signal contains the following frequencies: 25 Hz, 70
Hz, 160 Hz, and 510 Hz. Frequencies below the Nyquist frequency of
50 Hz are sampled correctly; those over 50 Hz appear as alias.
• Consider for example a signal composed of a single wave at a
frequency of 1 Hz:
ALIASING…

If we sample this waveform at 2 Hz (as dictated by the Nyquist


theorem), that is sufficient to capture each peak and trough of the
signal:
ALIASING

• If we sample at a frequency higher than this, for example 3 Hz,


then there are more than enough samples to capture the variations
in the signal:
ALIASING

If however we sample at a frequency lower than 2 Hz, for example at


1.5 Hz, then there are now not enough samples to capture all the peaks
and troughs in the signal:

Note here that we are not only losing information, but we are getting
the wrong information about the signal.
ALIASING

• Now we are ready to think about the sampling of a complex signal


composed of many frequency components.
• For example, the following waveform was composed by adding
together waves at frequencies of 1 Hz, 2 Hz, and 3 Hz:
ALIASING
• According to the Nyquist sampling theorem, the signal must be
sampled at twice the highest frequency contained in the signal.
• In this case, we have fc =3 Hz, and so the Nyquist theorem tells
us that the sampling frequency, fs , must be at least 6 Hz. And
sure enough, this appears to be sufficient:

Thus, when a signal contains not just one but many different
frequencies added together, the minimal sampling rate needed to
avoid aliasing is just twice whatever the highest frequency is,
irrespective of how many other frequency components there are.
SAMPLE RESOLUTION/SAMPLE SIZE

• Sample resolution (the number of bits per


sample)determines how many gradations of amplitude
(corresponding to loudness) can be represented in the
digital waveform.
• Common Sampling Rates
–8KHz: used for telephone
–11.025 KHz: Speech audio
–22.05 KHz: Low Grade Audio (WWW Audio, AM Radio)
–44.1 KHz: CD Quality audio
SAMPLE RESOLUTION…

• Each sample can only be measured to a certain degree


of accuracy.
• The accuracy is dependent on the number of bits used
to represent the amplitude, which is also known as the
sample resolution.

• How do we store each sample value (quantized value)?


• 8 Bit Value (0-255)
• 16 Bit Value (Integer) (0-65535)
SAMPLE RESOLUTION…

The amount of memory required to store t seconds long sample is as follows:


• If we use 8 bit resolution, mono recording
memory = f*t*8*1

• If we use 8 bit resolution, stereo recording


memory = f*t*8*2

• If we use 16 bit resolution, and mono recording


memory = f*t*16*1

• If we use 16 bit resolution, and stereo recording


memory =f* t*16*2

where f is sampling frequency, and


t is time duration in seconds
SAMPLE RESOLUTION…

Examples:
Gemechu sampled audio for 10 seconds. How much storage space is
required if
a) 22.05 KHz sampling rate is used, and 8 bit resolution with mono
recording?
b) 44.1 KHz sampling rate is used, and 8 bit resolution with mono
recording?
c) 44.1 KHz sampling rate is used, 16 bit resolution with stereo
recording?
d) 11.025 KHz sampling rate, 16 bit resolution with stereo
recording?
SAMPLE RESOLUTION…

Solution:
a) m=22050*8*10*1
m= 1764000bits=220500bytes=220.5KB

b) m=44100*8*10*1
m= 3528000 bits=441000butes=441KB

c) m=44100*16*10*2
m= 14112000 bits= 1764000 bytes= 1764KB

d) m=11025*16*10*2
m= 3528000 bits= 441000 bytes= 441KB
SAMPLE RESOLUTION…
Implications of Sample Rate and Bit Size
• Affects Quality of Audio
• Affects Size of Data

File Type 44.1 KHz 22.05 KHz 11.025 KHz


16 Bit Stereo 10.1 Mb 5.05 Mb 2.52 Mb
16 Bit Mono 5.05 Mb 2.52 Mb 1.26 Mb
8 Bit Mono 2.52 Mb 1.26 Mb 630 Kb

Table Memory required for 1 minute of digital audio


CLIPPING

• Both analog and digital media have an upper limit beyond which they can no
longer accurately represent amplitude.
• Analog clipping varies in quality depending on the medium.
• The upper amplitudes are being altered, distorting the waveform and
changing the timbre, but the alterations are slightly different.

• Digital clipping, in contrast, is always the same.


• Once an amplitude of 1111111111111111 (the maximum value in a 16 bit
resolution) is reached, no higher amplitudes can be represented.
• The result is not the smooth, rounded flattening of analog clipping, but a
harsh slicing of off the top of the waveform, and an unpleasant timbral
result.
CLIPPING…

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy