6 - Quantization
6 - Quantization
FACULTY OF ENGINEERING
DEPARTMENT OF COMPUTER AND COMMUNICATIONS ENGINEERING
QUANTIZATION
Digital Communications Systems
CCE 411
AUST – 2022
Quantization
Discrete sources are a subject of interest in their own right(for text, computer files, etc.) and also serve as the
inner layer for encoding analog source sequences and waveform sources.
This section treats coding and decoding for a sequence of analog values.
Quantization is the process of representing a large, possibly infinite, set of values with a smaller set.
GABY ABOU HAIDAR, PH.D.
Quantization
The second step in digitizing an analog signal is to quantize the amplitude of the sampled signal xs(t).
Quantization is the process of mapping a set of continuous amplitudes (infinite number of levels) into a finite number
of discrete values.
Obviously, this is a many-to-one mapping and, thus, in general we cannot recover exactly the analog signal from its
quantized version. We can, however, through appropriate design, minimize this distortion. We will refer to the
distortion introduced by quantization as quantization noise.
Let us assume that the analog signal to be quantized has amplitudes in the range −Vp ≤ V ≤ Vp volts, and that we map
all voltages in [−Vp;Vp] into L discrete levels.
The obvious question (which does not in general have an obvious answer) is: how do we choose these L discrete levels
such that the quantization noise is minimized?
Scalar quantization consists of two types: uniform quantization and non-uniform quantization.
GABY ABOU HAIDAR, PH.D.
Scalar Quantization
A scalar quantizer partitions the set R of real numbers into M subsets R1,...,RM, called quantization regions.
Assume that each quantization region is an interval. Each region Rj is then represented by a representation point aj ∈ R
When the source produces a number u ∈ Rj, that number is quantized into the point aj.
A scalar quantizer can be viewed as a function {q(u)} : R → R that maps analog real values u into discrete real values
q(u) where q(u) = aj for u ∈ Rj
Thus an L−level quantizer is specified by L−1 interval endpoints, b1,...,bL−1, and L representation points, a1,...,aL.
Quantization Noise
It needs to be mentioned at this stage that the quantization process introduces noise represented by the error or
difference between the input signal u and the quantized output signal q(u).
This error is called quantization noise, and it introduces distortion. When this error is made sufficiently small, the
original message signal and the quantized signal become practically indistinguishable to the human ear or eye
depending on whether u is a voice or picture signal.
This means that the analog message can be approximated by a signal constructed at discrete amplitudes which are
selected on a minimum error basis from an available set.
Clearly, the quantization noise can be reduced further by reducing the spacing between the adjacent quantization
levels or step-size.
An important question that needs to be answered in order to design a quantizer is the following: for a given value of
L, how can the regions and representation points be chosen to minimize the mean-square quantization error?
GABY ABOU HAIDAR, PH.D.
In order to minimize the error over the set of aj , it is simply necessary to choose aj to minimize the
corresponding integral, assuming that the regions are considered fixed.
If the regions are not fixed, then we need to minimize MSQE over the set of bj as well.
GABY ABOU HAIDAR, PH.D.
Taking the derivatives of the distortion with respect to the (2L−1) parameters and setting to zero every single
equation, we obtain the following conditions for the optimum quantization levels aj and quantization interval
boundaries bj: The MSQE can be written as:
To determine the quantized values aj, we differentiate with respect to aj and define b0 =−∞ and bL = +∞. Thus, we
obtain:
1. The optimum quantization interval boundaries are at the midpoints of the optimum quantization values:
2. The optimum quantization values are the centroids of the quantization intervals:
GABY ABOU HAIDAR, PH.D.
The usual method of designing the optimal quantizer is to start with a set of quantization regions and then
using the second criterion, to find the quantized values.
Then, we design new quantization regions for the new quantized values, and alternating between the two
steps until convergence (when the distortion does not change much from one step to the next).
Based on this method, one can design the optimal quantizer for various source statistics.
GABY ABOU HAIDAR, PH.D.
1) Choose an arbitrary initial set of M representation points a1 < a2 < ··· < aM.
3) For each j; 1 ≤ j ≤ M, set aj equal to the conditional mean of U given U ∈ (bj−1,bj) (where b0 and bM are taken to be
−∞ and +∞ respectively).
4) Repeat steps (2) and (3) until further improvement in MSE is negligible; then stop.
GABY ABOU HAIDAR, PH.D.
Thus if the algorithm terminates when the MSE improvement is less than some given ε > 0, then the algorithm must
terminate after a finite number of iterations.
The problem with the Max-Lloyd algorithm is that the algorithm might reach a local minimum of MSQE instead of the
global minimum.
This algorithm is a type of hill-climbing algorithm; starting with an arbitrary set of values, these values are modified
until reaching the top of a hill where no more local improvements are possible.
A reasonable approach in this sort of situation is to try many randomly chosen starting points, perform the Max-
Lloyd algorithm on each and then take the best solution.
This is somewhat unsatisfying since there is no general technique for determining when the optimal solution has
been found.
GABY ABOU HAIDAR, PH.D.
Where is the variance of U (we are assuming without loss of generality that U is zero-mean), and is
the probability of quantization values. The discrete random variable Q(U) takes values from the set of L optimum
quantization values with respective probabilities pj
GABY ABOU HAIDAR, PH.D.
Since U is zero-mean, this means Q(U) is zero-mean and thus the sum in the last equality is in fact the variance
of Q(U); thus the MMSQE (Minimum mean-square quantization error) for the optimum quantizer is:
GABY ABOU HAIDAR, PH.D.
Example:
GABY ABOU HAIDAR, PH.D.
Example: (Cntd..)
GABY ABOU HAIDAR, PH.D.
Uniform Quantization
This section analyzes the performance of uniform scalar quantizers.
For a uniform scalar quantizer, every quantization interval Rj has the same length |Rj| = ∆.
In other words, R (or the portion of R over which f (u) > 0), is partitioned into equal intervals, each of length ∆.
U
A uniform or linear quantizer has all the quantization levels uniformly distributed in the interval [−Vp ;Vp] (except
possibly the two intervals at the boundaries when the range of possible amplitudes is infinite).
In other words, the interval [−Vp ;Vp] is subdivided into L quantization intervals, and the quantization amplitudes are
assigned at the center of each quantization interval.
GABY ABOU HAIDAR, PH.D.
Uniform Quantization
output w2(t)
V
-V V
input w1(t)
-V
Region of operation
For M=2n levels, step size :
= 2V /2n = V(2-n+1)
GABY ABOU HAIDAR, PH.D.
For a uniform quantizer, the quantization intervals and their corresponding quantized amplitudes are
as shown in the figure below.
Any amplitude x within a quantization interval is assigned to the voltage in the middle of that interval
(except again possibly for the boundary intervals).
GABY ABOU HAIDAR, PH.D.
Quantizer Bit-rate
Thus, the input-output characteristic of a uniform quantizer is a stair case type characteristic and the spacing
between two adjacent quantization levels ak−1 and ak is called a “quantum” or “step-size”, and is denoted by ∆.
(Quantizer Bit-rate) If the number of possible quantizer’s outputs is L (L-level quantizer), then the quantizer bit
rate is:
Quantization Noise
An important performance measure for quantizers is the signal-to-quantization noise ratio (SQNR), defined by:
Example:
GABY ABOU HAIDAR, PH.D.
Quantization Noise
Therefore, it can be seen here that to reduce the quantization noise, ∆ needs to be reduced.
With the assumption that the quantization levels need to cover the entire dynamic range of the analog message, the
reduction of ∆ is equivalent to an increase in the number of quantization levels.
Also, for every additional bit of quantization, we improve the SQNR performance by about 6 dB (not a small amount).
It needs to be noted here that each quantization level is to be represented by a binary code word formed by a specific
number of binary digits, or bits.
This representation permits the transmission of the quantization levels in binary form.
Let R be the number of bits per sample used in the construction of the binary code.
Then, we can write: L = 2R, under the assumption of a fixed length coding.
Also, the average power of the quantization noise becomes:
GABY ABOU HAIDAR, PH.D.
Non-Uniform Quantization(Companding)
As long as the statistics of the input signal are close to the
uniform distribution, uniform quantization works fine.
••••
Channel
••••
Non-uniform Quantization(Companding)
Non-uniform Quantization(Companding)
For example, the range of voltages covered by voice signals,
from the peaks of loud talk to the weak passages of weak
talk, is on the order of 1000 to 1.
By using a non-uniform quantizer with the feature that the
step size increases as the separation from the origin of the
input-output amplitude characteristic is increased, the large
end-step of the quantizer can take care of possible
excursions of the voice signal into the large amplitude ranges
that occur relatively in frequently.
In other words, the weak passages that need more
protection are favored at the expense of the loud passages.
In this way, a nearly uniform percentage precision is
achieved throughout the greater part of the amplitude range
of the input signal, with the result that fewer steps are
needed than would be the case if a uniform quantizer were
used.
This figure illustrates a comparison between uniform and
non-uniform quantization for a speech voltage signal.
GABY ABOU HAIDAR, PH.D.
Companding Laws
The use of a nonuniform quantizer is equivalent to passing the message signal through a compressor and then
applying the compressed signal to a uniform quantizer.
A particular form of compression law that is used in practice is the so called µ-law defined by:
Companding Laws
The case of uniform quantization corresponds to µ =0. For a given µ, the reciprocal slope of the compression
curve, which defines the quantum steps, is given by the derivative of |m| which respect to |v|; that is:
We see therefore that the µ-law is neither strictly linear nor strictly logarithmic, but it is approximately linear at low
input levels corresponding to µ|m| << 1, and approximately logarithmic at high input levels corresponding to µ|m|
>> 1.
The µ-law used for signal compression is used in the United States, Canada, and Japan.
In Europe, another compression law known as the A-law is used for signal compression.
GABY ABOU HAIDAR, PH.D.
Companding Laws
The A-law is defined by:
To restore the reconstructed quantized and compressed signal to its correct amplitude levels, a device, called an
expander, is used at the receiver. The expander law is the inverse of the compressor law.
Note that the µ−law is used in T1 digital telephony systems(using twisted cables)that achieve a bit rate of 1.544Mbits/s,
and the A−law is used in E1 digital telephony systems (using coaxial cables or twisted cables) that achieve a bit rate of
2.048 Mbits/s.
GABY ABOU HAIDAR, PH.D.
- law compressor
(very popular internationally)
w1 (t ) 1
ln 1 w1 (t )
w2 (t )
ln 1
In the U.S., 255 is used.
GABY ABOU HAIDAR, PH.D.
Example:
GABY ABOU HAIDAR, PH.D.
Example:
GABY ABOU HAIDAR, PH.D.
Example:
GABY ABOU HAIDAR, PH.D.