Lesson 2 PCM
Lesson 2 PCM
– Encode
• Maps the quantized values to digital
words that are bits long.
Digital Output ➢ If the (Nyquist) Sampling Theorem is
Signal satisfied, then only quantization introduces
111 111 001 010 011 111 011 distortion to the system.
Eeng 360 4
Quantization
➢ The output of a sampler is still continuous in amplitude.
– Each sample can take on any value e.g. 3.752, 0.001, etc.
– The number of possible values is infinite.
1
equally spaced apart.
-8 -6 -4 -2 -1 2 4 6 8
• Uniform quantizers are
Input sample X
-3
optimal when the input
-5 distribution is uniform.
-7 When all values within the
Quantization Characteristic Dynamic Range of the
Example: Uniform =3 bit quantizer quantizer are equally likely.
q=8 and XQ = {1,3,5,7}
Types of Quantization
There are two types of Quantization - Uniform Quantization and Non-uniform
Quantization.
The type of quantization in which the quantization levels are uniformly spaced is
termed as a Uniform Quantization.
The type of quantization in which the quantization levels are unequal and mostly
the relation between them is logarithmic, is termed as a Non-uniform
Quantization.
There are two types of uniform quantization. They are Mid-Rise type and Mid-
Tread type. The following figures represent the two types of uniform quantization.
•The Mid-Rise type is so called because the origin lies in the
middle of a raising part of the stair-case like graph. The
quantization levels in this type are even in number.
Analogue signal
Sampling TIMING
Quantization levels.
Quantized to 5-levels
Quantization levels
Quantized 10-levels
PCM encoding example
M=8
M = 2n , n = log2 (M )
• Encoding is the process of representing each quantized sample
by a bit code word.
– The mapping is one-to-one so there is no distortion introduced by
encoding.
– Some mappings are better than others.
• A Gray code gives the best end-to-end performance.
• The disadvantage of Gray codes is that they will give poor
performance when the sign bit (MSB) is received in error.
Gray Codes
• With gray codes adjacent samples differ only in one bit position.
• Example (3 bit quantization):
XQ Natural coding Gray Coding
+7 111 110
+5 110 111
+3 101 101
+1 100 100
-1 011 000
-3 010 001
-5 001 011
-7 000 010
• With this gray code, a single bit error will result in an amplitude
error of only 2.
– Unless the MSB is in error.
Waveforms in a PCM system for M=8
M=8
M = 2n n = log 2 ( M )
M is the number of Quantization levels
(c) Error Signal n is the number of bits per sample