DSP Lecture 3
DSP Lecture 3
DSP Lecture 3
DIGITAL SIGNAL
PROCESSING
LECTURE 3
Quantization and Encoding
Focus in
this lecture
Filtering and Sampling: the analog signal is converted into a discrete-time continuous amplitude signal
through sampling (using a sample and hold (S/H) circuit) after being filtered (anti-aliasing – to be discussed
later).
Quantizing: the amplitude of each signal sample is quantized into one of the 2𝐵 levels, where B is the
number of bits used to represent a sample in the ADC.
Encoding: The discrete amplitude levels are encoded into distinct binary Words of length B bits.
Introduction to Quantizing
• After sampling, which converts a time-varying voltage signal into a
discrete-time signal quantization replaces each real number with an
approximation from a finite set of discrete values.
• Most commonly, these discrete values are represented as fixed-
point words. Though any number of quantization levels is possible,
common word-lengths are 8-bit (256 levels), 16-bit (65,536 levels)
and 24-bit (16.8 million levels).
• Quantization is representing the sampled values of the amplitude by
a finite set of levels, which means converting a continuous-
amplitude sample into a discrete-time signal. A device or
algorithmic function that performs quantization is called a quantizer
Analog signal before undergoing sampling and quantizing Quantizing the analog signal after sampling
Figure 3.4: This is also called as Stair-case waveform, in accordance with its shape
Quantization levels
• Both sampling and quantization result in the loss of information. The quality of a quantizer
output depends upon the number of quantization levels used. The discrete amplitudes of the
quantized output are called as representation levels or reconstruction levels. The spacing
between the two adjacent representation levels is called a quantum or step-size.
Figure 3.5 Quantization of two bits for sampled sinusoidal signal, Thin gray line-
, quantization level, thick black line-, sampled signal and blue circles marks-o, quantized signal
Quantization noise
The simplest way to quantize a signal is to choose the digital amplitude value closest to the
original analog amplitude.
Figure 3.6 This example shows the original analog signal (green), the quantized signal (black dots), the signal
reconstructed from the quantized signal (yellow) and the difference between the original signal and the reconstructed
signal (red).
Explanation of Quantization noise
In a PCM stream, the amplitude of the analog signal is sampled at uniform intervals,
and each sample is quantized to the nearest value within a range of digital steps.
A-law has mid-rise at the origin. Hence, it µ-law has mid-tread at the origin. Hence, it
contains a non-zero value. contains a zero value.
A-law companding is used for PCM µ-law companding is used for speech and
telephone systems. music signals.
Illustration of PCM:
Assign
closest level
Figure 3.12 a) Quantized signal with low quantization levels b) Quantized signal with high quantization levels
https://slideplayer.com/slide/13774234/
https://www.tutorialspoint.com/digital_communication/digital_communication_qua
ntization.htm#
Castillo, P. C. A., Brennan, M. J., de Almeida, F. C. L., de Lima, F. K., de Sousa Obata, D.
H., & Paschoalini, A. T. An Investigation Into The Effects Of Signal Distortion On The
Accuracy Of Time Delay Estimation For Leak Detection In Buried Plastic Water Pipes.
https://en.wikipedia.org/wiki/Pulse-code_modulation