Digital Signal Processing (ECN-312)
Lecture 4 (Quantization)
Dheeraj Kumar
[email protected]
January 23, 2023
Table of Contents
1 Analog-to-digital A/D conversion
Analysis of quantization errors
2 / 18
From discrete-time to digital signals
❑ So far, our discussions of the representation of continuous-time
signals by discrete-time sequence have focused on:
❑ Idealized models of periodic sampling
❑ Bandlimited interpolation
❑ But discrete-time systems have infinite precision
❑ x[n] can take any real values (infinite options)
❑ To convert a discrete-time signal into a digital signal, one more
step is needed
❑ Limit the range of values x[n] can take
❑ Quantization
❑ Like sampling along the y -axis
3 / 18
Discrete-time vs digital signal processing
4 / 18
Table of Contents
1 Analog-to-digital A/D conversion
Analysis of quantization errors
5 / 18
Introduction
❑ An ideal C/D converter converts a continuous-time signal into a
discrete-time signal
❑ Each sample is known with infinite precision
❑ For digital signal processing (DSP), we need to converts a
continuous-time (analog) signal into a digital signal
❑ A sequence of finite-precision or quantized samples
6 / 18
Sample and hold
❑ A physical device that converts a voltage or current amplitude at
its input into a binary code
❑ A quantized amplitude value closest to the amplitude of the input
❑ Start and complete an A/D conversion every T seconds (not
instantaneous)
❑ High-performance A/D system typically includes a
sample-and-hold
P∞ P∞
❑ x0 (t) = h0 (t) ∗ n=−∞ xa (nT )δ(t − nT ) = n=−∞ x[n]h0 (t − nT )
❑ x[n] = xa (nT ) are the ideal samples of xa (t)
❑ h0 (t) is the impulse response of the zero-order-hold system
(
1, 0 < t < T ,
❑ h0 (t) =
0, otherwise
7 / 18
Sample and hold
❑ Output of the zero-order hold (x0 (t)) is a staircase waveform
where the sample values are held constant during the sampling
period of T seconds
8 / 18
A/D converter
❑ Physical configuration for analog-to-digital converter can be
shown as:
❑ Ideal C/D converter represents the sampling performed by the
sample-and-hold
❑ The quantizer and coder together represent the operation of the
A/D converter
9 / 18
Quantizer and coder
❑ A quantizer is a nonlinear system whose purpose is to transform
the input sample x[n] into one of a finite set of prescribed values
❑ x̂[n] = Q(x[n])
❑ Can be defined with either uniformly or non-uniformly spaced
quantization levels
❑ Leads to “uniform” and “non-uniform” quantizers respectively
❑ A coder is a linear mapping from quantized output (x̂[n]) to a
sequence of binary numbers (x̂B [n])
10 / 18
Typical quantizer for A/D conversion (Uniform
quantization)
11 / 18
Typical quantizer for A/D conversion
❑ This quantizer is appropriate for a signal whose samples are both
positive and negative (bipolar)
❑ If input samples are always positive (or negative), then a different
distribution of the quantization levels would be appropriate
❑ In general, 2B+1 quantization levels can be coded with a B + 1-bit
binary code
❑ In this example, 8 quantization levels → 3-bit binary code
❑ Many binary coding schemes exist, each with its own advantages
and disadvantages, depending on the application
❑ Offset binary coding: symbols are assigned in numeric order,
starting with the most negative quantization level
❑ Two’s complement coding: Most significant bit is considered as the
sign bit, and the remaining bits as binary integers or fractions
12 / 18
Step size
❑ Relationship between the code words and the quantized signal
levels depends on the parameter Xm
❑ Full-scale level of the A/D converter
❑ Typical values are 10,5, or 1 volt
2Xm Xm
❑ Step size of the quantizer: ∆ = 2B+1
= 2B
❑ Smallest quantization levels (±∆) correspond to the least
significant bit of the binary code word
13 / 18
Quantization and coding example
14 / 18
Table of Contents
1 Analog-to-digital A/D conversion
Analysis of quantization errors
15 / 18
Quantization error
❑ Quantized sample x̂[n] will generally be different from the true
sample value x[n]
❑ Difference between them is the quantization error:
e[n] = x̂[n] − x[n]
❑ For a (B + 1)-bit quantizer with step size ∆
❑ If x[n] lies between two quantization levels, i.e.,
−Xm − ∆ 2 < x[n] ≤ Xm − 2
∆
∆ ∆
❑ Then − 2 < e[n] ≤ 2
∆
❑ If x[n] is outside this range, (e.g., sample at t = 0), |e[n]| > 2
❑ Such samples are said to be clipped
16 / 18
Additive noise model for quantizer
❑ A simplified, but useful model of the quantizer considers
quantization error as an additive noise signal
❑ Model is exactly equivalent to the quantizer if we know e[n]
❑ However, e[n] is usually not known, and a statistical model is
useful in representing the effects of quantization
17 / 18
Thanks.