Multimedia
Principles
Chapter 2
Digital Representation
TMH Chapter - 2 1
Digital Representation
Analog
An analog quatity can vary continuously over space and/or time.
It is represented as f(x,y,z,t).
Analog physical quantities can be transformed into electrical
signals using sensors.
Signals can be represented as waves which can take up any possible
real values within the instrument range (amplitude continuous).
Value of the analog signal can be determined for any possible value of
space or time variable (space or time continuous).
TMH Chapter - 2 2
Digital Representation
Analog
TMH Chapter - 2 3
Digital Representation
Waves
Waves can be conceived as energy propagating from one place
to another either through a material medium or through vacuum.
Because a wave is in general associated with oscillatory or vibrational
forces, we think of a mean position about which a particle is oscillating
giving rise to the concept of positive and negative displacements
A wave therefore essentially represents a graph or plot of the motion of
a particle or a set of particles in the path of a wave over space or time.
TMH Chapter - 2 4
Digital Representation
Waves
It is customary however to to explain the concepts of a wave by
considering a sinusoidal function i.e. y = Asin(x) or y = Bcos(x).
This is because sinusoids are easier to deal with as they are periodic
functions and can be represented by simple equations.
Also it has been demonstrated by the French mathematician Jean
Baptiste Fourier that any irregular shaped wave can be thought to be a
combination of a number of sine and cosine waves
Sinusoidal waves therefore can be considered to be a kind of
elementary wave which can be used as building blocks to generate
other waves.
TMH Chapter - 2 5
Digital Representation
Waves
TMH Chapter - 2 6
Digital Representation
Waves
The peak amplitude of a wave is the maximum displacement of
the oscillating particle from its mean position.
The amplitude actually represents the intensity of the physical quantity
e.g. the brightness of light, the loudness of sound, the voltage / current
level of electricity etc.
The frequency refers to how fast the particle is oscillating and is defined
as the number of oscillations completed by the particle in unit time.
Frequency physically represents the pitch of sound or color of light. A
higher pitch results in a shrill sound e.g. a whistle, while a lower pitch
results in a dull and flat sound e.g. sound of a padded hammer.
TMH Chapter - 2 7
Digital Representation
Waves
TMH Chapter - 2 8
Digital Representation
Waves
The waveform essentially represents the shape of the wave and
signifies the change of the amplitude and frequency over time.
The sinusoidal shape represents the elementary wave but waves can
have any shape like triangular, square, half-sinusoidal etc. A wave can
also have an irregular shape without any apparent periodicity.
The waveform determines the timber or quality of the physical quantity.
For sounds, it allows us to distinguish between the sound of a violin,
guitar and sitar even though all of them may be playing at the same
loudness and pitch.
TMH Chapter - 2 9
Digital Representation
Waves
TMH Chapter - 2 10
Digital Representation
Waves
Two or more sinusoidal waves can combined together to
generate a composite wave which may have a non-sinusoidal
shape
The composite shape is obtained by adding up the amplitudes of the
component waves at all points. The composite shape also depends on
the relative positions of the component waves.
TMH Chapter - 2 11
Digital Representation
Waves
TMH Chapter - 2 12
Digital Representation
Waves
Sinusoidal waves are not mathematical abstractions, they can be
produced in the real world by a phenomenon called simple harmonic
motion (SHM)
TMH Chapter - 2 13
Digital Representation
Waves
Temporal waves depict the state of a single particle in the path of
a wave over a period of time. It is pictorially depicted as a graph
plotted with time as the horizontal axis and amplitude as the
vertical axis.
Different points on the wave depict the state of the particle i.e. its
displacement from the mean position, at different instants of time.
A spatial wave on the other hand depict the states of several particles in
the path of a wave at a single instant of time.
Different points on the graph depict the states of different particles at the
particular instant at which the snapshot was taken.
TMH Chapter - 2 14
Digital Representation
Waves
TMH Chapter - 2 15
Digital Representation
Waves
The speed of transmission of a wave is the distance traveled by
it in unit time, as the wave is propagated from the source to the
destination.
A wave is said to be periodic if it repeats its waveform pattern
periodically, otherwise it is said to be aperiodic
It can be shown that an aperiodic wave may be thought to be a
combination of a large number (theoretically infinite) number of
sinusoidal waves.
TMH Chapter - 2 16
Digital Representation
Waves
TMH Chapter - 2 17
Digital Representation
Digital
In contrast to analog quantities, digital quantities are not
continuous over space or time, and as such they cannot be
represented by smooth waves.
They are discrete in nature which means that they exist or have values
only at certain points in space or instants in time, but not at other points
or instants
A digital computer can only recognize digital values. The reason for this
is due to the internal architecture of the computer.
TMH Chapter - 2 18
Digital Representation
Digital
TMH Chapter - 2 19
Digital Representation
Digital
Each alphanumeric character is represented by a combination of
1s and 0s known as its ASCII code (American Standard Code for
Information Interchange) using which they are represented
internally within a computer
Since the numbers comprise of only 1s and 0s, the code is known as
binary code.
Each of these digits is known as a bit, short for binary digit, while a
collection of 8 bits is called a byte.
TMH Chapter - 2 20
Digital Representation
A to D Conversion
The first step in converting an analog quantity to a digital form is
called sampling.
Sampling involves breaking the continuous wave into a discrete set of
points. This is done by examining the wave at certain points and
recording the values of the wave at those points discarding other values
For time-dependant quantities like sound, sampling is done at specific
intervals of time (e.g. 10 times per second) and is said to create time-
discretization of the signal.
For time-independent quantities like a static image, sampling is done at
regular space intervals and is said to create space-discretization of the
signal (e.g. 10 times per inch).
TMH Chapter - 2 21
Digital Representation
A to D Conversion
TMH Chapter - 2 22
Digital Representation
A to D Conversion
The input analog value must be held constant during the
conversion process to avoid inconsistencies due to changing
values. This operation is called sample-and-hold
The rate or frequency at which the sampling occurs is known as
sampling rate or sampling frequency, and denotes the number of
samples taken per second or per inch.
Higher the sampling rate more is the number of samples of the original
wave that are obtained and better is its representation after digitization.
However a larger number of samples also means more data to store
and manipulate and therefore involves higher costs.
TMH Chapter - 2 23
Digital Representation
A to D Conversion
TMH Chapter - 2 24
Digital Representation
A to D Conversion
Another important point to be noted is that a digitized version will
always be a degraded version of the original analog wave,
because no matter how large the sampling rate is, we are bound
to discard and lose some data in between two sample values.
Quantization levels refer to the number of different sample
values that can be used to represent a digital quantity.
Since the sample values actually represent the amplitudes of the
analog wave at different time (or space) instants, the process of
selecting a fewer number of amplitude levels from a larger set is
known as amplitude-discretization
TMH Chapter - 2 25
Digital Representation
A to D Conversion
TMH Chapter - 2 26
Digital Representation
A to D Conversion
Code-word generation involves expressing these amplitude
levels in terms of binary codes or numbers, because that is
finally how the data would be represented within a computer.
To represent the quantized amplitude levels as binary numbers,
we follow the well-known rule that starting with n number of bits,
it is possible to generate a total of 2n binary numbers, and their
values range from 0 to 2n –1.
Here n is known as the bit-depth.
TMH Chapter - 2 27
Digital Representation
A to D Conversion
TMH Chapter - 2 28
Digital Representation
A to D Conversion
Nyquist’s theorem states:
When converting an analog signal into digital form, the sampling
frequency must be greater than twice the bandwidth of the input
signal in order to be able to reconstruct the original signal
accurately from the sampled version.
For a baseband signal the bandwidth is same as the highest
frequency component of the signal, and so the theorem is often
stated as the sampling frequency needs to be twice the highest
frequency component of the input signal.
TMH Chapter - 2 29
Digital Representation
A to D Conversion
The higher frequencies lead naturally to a good approximation of
the wave.
When sampling frequency is decreased to twice the frequency of
the analog wave the output wave is quite blocky in appearance
but at least all the cycles of the sinusoid are reproduced. .
When the sampling frequency is less than twice the frequency of
the wave, we see that the output now consists of a very low
frequency wave which fails to reproduce all the cycles of the
sinusoid.
TMH Chapter - 2 30
Digital Representation
A to D Conversion
The low frequency distortion produced due to the lowest
sampling rate, known as under-sampling, is referred to an
aliasing, because the input wave is not truly represented at the
output.
The sampling frequency that is half that of the input wave
frequency, is referred to a Nyquist frequency.
A consequence of the Nyquist’s theorem is that for a given
sampling frequency, any component of the input wave having a
frequency higher than twice that of the sampling frequency, is
likely to cause aliasing distortion at the output.
TMH Chapter - 2 31
Digital Representation
A to D Conversion
TMH Chapter - 2 32
Digital Representation
A to D Conversion
To prevent this an analog to digital converter contains a band-limiting
filter preceeding the sampling circuit so that all high frequency
components can be removed from the signal before it is sampled. This
filter is called an anti-aliasing filter
Physically the conversion of an analog signal into digital form is done
using an electronic circuit called an encoder. The encoder consists of
the actual digital to analog converter (ADC) where the three stages of
sampling, quantization and code-word generation is executed.
The ADC is preceded by an anti-aliasing filter to remove high frequency
components from the input signal thereby avoiding possible distortion.
TMH Chapter - 2 33
Digital Representation
A to D Conversion
TMH Chapter - 2 34
Digital Representation
D to A Conversion
A picture or an audio clip would be stored on a hard disk as bit
patterns, but when the picture is to be displayed on the screen or
the audio clip needs to be played on a speaker, a digital to
analog conversion is required.
This is implemented by passing the digital output through a
device called a signal decoder. It consists of the digital to analog
converter (DAC) followed by a low-pass filter.
Essentially a mechanism is employed which is similar to passing
the digital pulse through a capacitor whose finite charging and
discharging times generate a smooth curve.
TMH Chapter - 2 35
Digital Representation
D to A Conversion
TMH Chapter - 2 36
Digital Representation
D to A Conversion
After the DAC the generated analog waveform is passed through
a low-pass filter which filters out any high-frequency
components.
Normally the high-frequency cut-off of the low pass filter is made
the same as that used in the band-limiting filter of the encoder.
In real-world applications, most of the equipment are expected to
support encoding and decoding simultaneously since multimedia
communications are generally 2-way. Hence ADC and DAC are
often combined into a single unit called an encoder-decoder or
ADC-DAC set.
TMH Chapter - 2 37
Digital Representation
D to A Conversion
TMH Chapter - 2 38
Digital Representation
Quantization Error
During the quantization stage, we consider only a limited number
of samples while discarding the rest.
This leads to errors in the digital output which are referred to as
quantization errors.
Because of quantization error there is always a distortion of the
wave when represented digitally. This distortion effect is referred
to as noise.
TMH Chapter - 2 39
Digital Representation
Quantization Error
TMH Chapter - 2 40
Digital Representation
Quantization Error
To eliminate noise fully during digitization we must sample at an
infinite rate which is impossible in practice.
Hence because of the quantization error digitization always
means a degradation of the original analog wave. This
degradation is usually compensated at a later stage through the
use of editing software.
The signal-to-noise ratio (SNR) is the ratio between the power of
the desired signal (useful information) and the power of noise
(unwanted signal)
TMH Chapter - 2 41
Digital Representation
Fourier Representation
Fourier representation, is a mathematical technique which shows that
any periodic signal i.e. a signal which repeats itself in equal time
intervals, is made up of an infinite series of sinusoidal frequency
components.
There are 4 types of Fourier representations depending on the nature of
the input wave:
(a) Fourier Transform : resulting from continuous and a-periodic input
(b) Fourier Series : resulting from continuous and periodic input
(c) Discrete Time Fourier Transform : resulting from discrete and a-
periodic input
(d) Discrete Fourier Transform : resulting from discrete periodic input
TMH Chapter - 2 42
Digital Representation
Fourier Representation
Each of the four Fourier representations can be of two versions :
real and complex. The real version uses real numbers for
decomposition and synthesis while the complex version uses
complex numbers.
The term transform is used to mean an algorithm which can
convert a set of values, either continuous or discrete, to another
set of values, not necessarily of the same number of even of the
same type.
The DFT converts a signal in time domain to a set of signals in
frequency domain.
TMH Chapter - 2 43
Digital Representation
Fourier Representation
The DFT would convert this N sample time domain signal into
two signals each of N/2+1 samples long in the frequency
domain.
These two signals essentially contain the values of the amplitude
of the two sinusoidal components into which the original signal
has been split.
The first component is a cosine wave, also known as the real
part and written as Re, and the second component is the sine
wave, also known as the imaginary part and written as Im.
TMH Chapter - 2 44
Digital Representation
Fourier Representation
TMH Chapter - 2 45
Digital Representation
Fourier Representation
The frequency domain contains exactly the same information as
the original wave in the time domain, just expressed in a different
form e.g. analogous to 6 being expressed as 3+3.
The process of converting the time domain signal into the
frequency domain signal is called the forward DFT, while the
reverse process of calculating the time domain signal from the
frequency domain signal is referred to as the inverse DFT.
In digital signal processing time domain signals are represented
in lower case e.g. x[ ] while frequency domain signals are written
in upper case e.g. X[ ].
TMH Chapter - 2 46
Digital Representation
Fourier Representation
The output of the DFT is a set of numbers which are to be used
as scaling factors for a set of sine and cosine waves. The sine
and cosine waves have unity amplitude and is called the basis
functions.
These are to be multiplied by necessary scaling factors to
produce a set of scaled sine and cosine waves, which when
added up form the time domain signal.
The synthesis equation or inverse DFT expresses the time
domain signal in terms of the frequency domain signal, while the
analysis equation or forward DFT expresses the frequency
domain signal in terms of the time domain signal.
TMH Chapter - 2 47
Digital Representation
Fourier Representation
TMH Chapter - 2 48
Digital Representation
Fourier Representation
TMH Chapter - 2 49
Digital Representation
PCM
This process of encoding digital information in terms of voltage
signals is called modulation and is done using a device called a
modulator.
Formally modulation is a process of varying a carrier signal,
typically sinusoidal, for conveying certain information.
Pulse code modulation (or PCM) is the name given to the
digitization of analog signals where the digital signal is
represented in terms of code-words.
TMH Chapter - 2 50
Digital Representation
PCM
Although the basic technique involves sampling and quantization
according to the ITU-T recommendations G.711 a PCM circuit
should include additional components called a compressor and
an expander
In order to reduce the pronounced effect of quantization noise for
low amplitude signals, the compressor circuit in the encoder
makes the quantization intervals non-uniform.
This helps to reduce noise and improve the overall performance.
At the decoder, the expander circuit performs the reverse
function to retrieve the original analog wave.
TMH Chapter - 2 51
Digital Representation
PCM
TMH Chapter - 2 52
Digital Representation
Merits and Demerits
The key advantage of the digital representation lies in the universality of
representation.
Since any media element, be it text or image or sound or video, can be
represented using an uniform sequence of binary digits, all kinds of
information can be handled in the same way.
The same digital storage device, like memory chips, hard disks, floppies
and CD-ROMs, can be used for all media type like text, images,
graphics, audio, video and animation.
Any single communication network capable of supporting digital
transmission has the potential to transmit any multimedia information.
Digital signals are less sensitive to noise than analog signals.
TMH Chapter - 2 53
Digital Representation
Merits and Demerits
Powerful software programs can be used to analyze, modify,
alter and manipulate multimedia data in a variety of ways. This is
probably where the potential is the highest.
The major drawback lies in the coding distortion. The process of
first sampling and then quantizing and coding the sampled
values introduces distortions.
Another consequence is the requirement of large digital storage
capacity required for storing image, sound and video.
TMH Chapter - 2 54