You are on page 1of 43

Fundamentals of Digital Sound

 Introduction to sound.

 Multimedia system sound.

 Digital audio.

 MIDI audio.

 Audio file formats.


IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
1
Introduction to Sound

 Sound is a form of energy, caused by molecules vibrating

 Vibrations in the air create waves of pressure perceived as

sound.
 Sound waves vary in sound pressure level (amplitude) and in

frequency or pitch.
 Sound pressure levels measured in decibels (dB).

 Humans hear sound over a very broad range.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


2
Introduction . . . (cont’d)
 Sound comprises the spoken word, voices, music and even

noise. It is a complex relationship involving:


 a vibrating object (sound source)
 a transmission medium (usually air)
 a receiver (ear) and;
 a preceptor (brain).

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


3
Introduction . . . (cont’d)
Sound is described in terms of two characteristics:

– Frequency (or pitch)

– Amplitude (or loudness)

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


4
Frequency of Sound
 It is measure of how many vibrations occur in one second.

 Measured in Hertz (abbreviation Hz) and directly


corresponds to the pitch of a sound.
 The more frequent vibration occurs the higher the pitch of

the sound.

Low Pitch High Pitch


IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
5
Frequency of Sound
 People can hear from 20 Hz to 20,000 Hz (20 kHz)

 Sounds below 20 Hz are infrasonic.

 Sounds above 20 kHz are ultrasonic.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


6
Amplitude
 It is the maximum displacement of a wave from an equilibrium

position.
 Loud sounds have a large amplitude. (The louder the sound, the

more energy it has).

Quiet Loud

Low amplitude High Amplitude


IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
7
Types of Sound

Analog sound
 Sound itself is a continuous wave; it is an analog signal

.
 It is the true representation of the sound at the moment

it was recorded.
 what the microphone receives is exactly what's written

onto the vinyl disk or cassette.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


8
Types of Sound

Digital sound
 It is not a recording of the actual sound, but rather a

combination of binary code.


 The binary code is arranged in a specific pattern

informing the computer how to recreate the sound

itself.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


9
Analog to Digital Conversion
 Why Digitize?

 Microphones, video cameras produce analog signals (continuous


valued voltages)
 To store audio or video data into a computer, it must digitize it by
converting it into a stream of numbers.
Digitizing

 the process of converting an analog signal to a


digital one.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


10
Analog to Digital . . . (Cont’d)

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


11
Analog to Digital . . . (Cont’d)
Digitizing
 the process of converting an analog signal to a digital one.

 Analog signal is sampled. Digitized audio is sampled audio.

 Sampling is the process of taking periodic measurements of

the continuous signal.


 Samples are taken at regular time interval, i.e. every T

seconds.
 Many times each second, the analog signal is sampled. How

often these samples are taken is referred to as sampling rate.


 The amount of information stored about each sample is

referred to as sample size.

12 IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


Analog to Digital . . . (Cont’d)
 The higher the sampling rate, the more the measurements are
taken (better quality).
 The lower the sampling rate, the lesser the measurements are
taken (low quality)
High Sampling Rate

Low Sampling Rate

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


13
Analog to Digital . . . (Cont’d)
 
 Sampling: Divide the horizontal axis (time) into discrete pieces

 Quantization: Divide the vertical axis (signal strength - voltage)

into pieces.
 8-bit quantization divides the vertical axis into 256 levels (.

 16-bit gives you 65536 levels ().

 Lower the quantization, lower the quality of the sound.

 If the scale used for the vertical axis is linear we say its linear

quantization.
 If its logarithmic then we call it non-linear.
IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
14
Analog to Digital . . . (Cont’d)

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


15
Analog vs. Digital Sound

Analog Digital
Signal Continuous signal which Discrete time signals
represents physical generated by digital
measurements. modulation.
Waves Denoted by sine waves Denoted by square waves
Information Uses continuous range of Uses discrete or
Representation values discontinuous values
Example Human voice in air, analog Computers, CDs, DVDs,
electronic devices. and other digital electronic
devices.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


16
Analog vs. Digital . . . (Cont’d)
Analog Digital
Technology Records waveforms as Samples analog waveforms into a
they are. limited set of numbers and records
them.

Data Subjected to deterioration Can be noise-immune without


transmissions by noise during deterioration during transmission
transmission and and write/read cycle.
write/read cycle.

Response to More likely to get affected Less affected since noise response
Noise reducing accuracy are analog in nature
Flexibility Analog hardware is not Digital hardware is flexible in
flexible. implementation.
17 IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
Analog vs. Digital . . . (Cont’d)

Analog Digital
Uses Can be used in analog Best suited for Computing and
devices only. Best suited for digital electronics.
audio and video
transmission.
Bandwidth Analog signal processing There is no guarantee that digital
can be done in real time and signal processing can be done in
consumes less bandwidth. real time and consumes more
bandwidth to carry out the same
information.
Memory Stored in the form of wave Stored in the form of binary bit
signal

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


18
Analog to Digital . . . (Cont’d)
 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/Sample Size

 Each sample can be measured to a certain degree of accuracy.

 The accuracy is dependent on the number of bits used to

represent the amplitude (sample resolution).

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


19
Analog to Digital . . . (Cont’d)
 
How do we store each sample value (quantized value)?

 8 Bit Value (0-255)

 16 Bit Value (Integer) (0-65535)

 The amount of memory required to store t seconds long

• is the sampling Frequency


• is the duration of time in seconds
 For 8 bit resolution, mono recording

 For 8 bit resolution, stereo recording

 For 16 bit resolution, mono recording

 For 16 bit resolution, stereo recording


IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
20
Graphic/Image . . . (Cont’d)
 Exercise

 Someone sampled audio for 10 seconds. How much storage space is required

if
 22.05 KHz sampling rate is used, and 8 bit resolution with mono

recording? (Ans. 220.5KB )


 44.1 KHz sampling rate is used, and 8 bit resolution with mono recording?

(Ans. 441KB )
 44.1 KHz sampling rate is used, 16 bit resolution with stereo recording?

(Ans. 1764KB )
 11.025 KHz sampling rate, 16 bit resolution with stereo recording?

(Ans. 441KB )

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


21
Musical Instrument Digital Interface (MIDI)

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


22
MIDI (Cont’d)
 MIDI is protocol that enables to communicate computer,

synthesizers, keyboards, and other musical devices with each


other.
 Setup:

 MIDI OUT of synthesizer is connected to MIDI IN of

sequencer.
 MIDI OUT of sequencer is connected to MIDI IN of

synthesizer and "through" to each of the additional


sound modules.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


23
MIDI (Cont’d)
 Working:

 During recording, the keyboard equipped synthesizer is used

to send MIDI message to the sequencer, which records them.


 During play back, messages are sent out from the sequencer

to the sound modules and the synthesizer which will play


back the music.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


24
Components of MIDI
 Synthesizer

 It is a sound generator (various pitch, loudness, tone)

 A good synthesizer often has microprocessor, keyboard,

control panel, memory, etc.


 Sequencer

 A stand-alone unit or a software program for a personal

computer.
 It can be a storage server for MIDI data.

 Nowadays, it is more music editor software.

 It has one or more MIDI in and MIDI out.


IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
25
Components of MIDI
 Track

 Track in sequencer is used to organize the recording.


 Track can be turned on or off on recording or playing back.
 Channel

 Used to separate information in a MIDI system.


 There are 16 channel in MIDI system.
 Channel numbers are coded in each MIDI message.
 Timbre

 The quality of sound


 Multitimbral:- capable of playing many different sounds at the same
time (piano, flute, drum, . . ., etc)

26 IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


Editing Operations in Digital Audio

 Trimming: Removing dead air or blank space and so on. Done

using commands like cut , clear , Erase, Silence.


 Splicing and Assembly: Removal of extraneous noise , touch up,

creating a longer recording by mixing many small recordings.


 Volume adjustments: when we combine one or more recording

with different volume level, they must be made to run with a


consistent volume level. We need to normalize it with a sound
editor to a particular level.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


27
Editing Operations in . . . (Cont’d)
 Format Conversion: While saving different formats are

made available for sounds. Data may be lost during


conversion. MP3,MP4
 Resampling and down sampling: if we have sound recorded

and edited the sound at 16 bit sampling rate and using lower
rates then RS & DS is necessary, as we may save lots of disk
space.
 Fade in & Fade out: useful for sections that requires this

effect. This enveloping helps to smooth out a beginning and


end of the sound file. Format conversion
IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
28
Editing Operations in . . . (Cont’d)

 Equalization: allow us to modify a recordings frequency

content so that it sounds brighter or darker


 Time Stretching: allows to alter the length of the file .

Useful but may degrade audio quality of the file.


 Digital Sound Processing: allows signals with
reverberation, multi tap delay, chorus, flange and other
special effects using DSP routines.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


29
Editing Operations in . . . (Cont’d)

 Reversing Sound: Reversing or a part of a recording.


 Multiple Tracks: Being able to edit and combine multiple
tracks, merge tracks and then export them in a final mix to a
single audio file is important.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


30
MIDI vs. Audio sound
Comparison MIDI Digitized Audio
Representation Shorthand representation Sampling is done to
of music stored in convert the data into
numeric form digital form
Device Device dependent Device Independent
Independence
File Size 200 to 1000 times Larger File Size
smaller than Digitized
Audio
Memory Less storage space Large Storage space
Requirement
Edit Option Easily editable and all the Difficult to edit.
information retainable

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


31
MIDI Vs Audio sound

Comparison MIDI Digitized Audio


Quality Better when played on high Not so better
quality MIDI device
Playback Does not have consistent Consistent
playback quality playback quality
Analogy Vector Graphics Bitmap Images
Ease to Must have knowledge Does not require
incorporate much knowledge

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


32
Audio File Format
 It is a file format for storing digital audio data on a computer

system.
 This data can be stored uncompressed, or compressed to reduce

the file size.


 It can be a raw bit-stream, but it is usually a container format

or an audio data format with defined storage layer.


 The three major groups of audio file formats.

 Uncompressed audio formats.

 Formats with lossless compression.

 Formats with lossy compression.

33 IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


Audio File Format (Cont’d)
 Uncompressed audio formats,

 such as WAV, AIFF, AU or raw header-less PCM;

 Formats with lossless compression

 such as FLAC, Monkey's Audio (filename extension APE),

WavPack (filename extension WV), TTA, ATRAC Advanced


Lossless, Apple Lossless (filename extension m4a), MPEG-4 SLS,
MPEG-4 ALS, MPEG-4 DST, Windows Media Audio Lossless
(WMA Lossless), and Shorten (SHN).
 Formats with lossy compression

 such as MP3, Vorbis, Musepack, AAC, ATRAC and Windows Media

Audio Lossy (WMA lossy)).


IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
34
Audio File Format (Cont’d)

 .mid MIDI (Musicl Instrument Digital Interface)


 .wav Waveform Extension
 .aif Audio Interchange Format
 .mp2 .mp3 Motion Picture Expert Group Audio - also
referred to as MPEG-1 layer-2 or MPEG-1
Layer-3
 .ra .ram .rpm Real Audio

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


35
Audio File Format (Cont’d)

 .MID

 Wide support in many browsers with no need for a plugin.

 Have very good sound quality, but this can vary somewhat

with the quality of the sound card.


 Very small file size for a lengthy selection.

 The files are instrumental only.

 The files can not be recorded.

 They must be synthesized on a computer with special

hardware and software.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


36
Audio File Format (Cont’d)

 WAV

 Very good sound quality.

 Widely supported in many browsers with no need for a

plugin.
 You can record your own .wav files from a CD, tape,

microphone, etc.
 The very large file sizes severely limit the length of the

sound clips that you can use on your Web pages.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


37
Audio File Format (Cont’d)

 .AIF

 Very good sound quality.


 Widely supported in many browsers with no need for a
plugin.
 You can record your own .aif files from a CD, tape,
microphone, etc.
 The very large file sizes severely limit the length of the
sound clips that you can use on your Web pages.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


38
Audio File Format (Cont’d)

 .MP2/.MP3/.Mp4

 It is a compressed format which makes the sound files smaller.


 The sound quality is very good.
 If an MP3 file is recorded and compressed properly, the quality

can rival that of an actual CD.


 The file size is still larger than a Real Audio file and a whole

song would still take quite awhile to download over a normal

phone line connection.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


39
Audio File Format (Cont’d)
 .RA/.RAM/.RPM

 Very high degree of compression with smaller file sizes


than .mp2 or .mp3.
 Whole songs files are reasonable to download.
 The files can be "streamed" from a normal Web server
without any special software so that the audience can begin
listening to the sound before the file has completely
downloaded.
 Whole songs will start playing within seconds over normal
phone line connections.
IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)
40
Audio File Format (Cont’d)

 .RA/.RAM/.RPM (Cont’d)

 The sound quality is poorer than .mp2/ .mp3 files, but the new

G2 player and encoder have increased the quality considerably.


 Your audience must download and install a helper application

or plugin in order to appreciate the excellent quality of the new

G2 standard.
 However, browser manufacturers are beginning to include a

plug-in for the older version 5 player with the browser

downloads.

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


41
Popular Media Players

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


42
 MatLab Exercise on reading Audio files

clc
[y, Fs] = audioread('HBD2.mp3');
player = audioplayer(y, Fs)
play(player);
pause(player);
resume(player);
stop(player);

IT 516 (Multimedia Systems) Compiled by Asefa M. (MSc.)


43

You might also like