442 CHAPTER 7: Sampling Theory
FIGURE 7.12
Four-level quantizer and coder.ΔΔ10110100
− 2 Δ −Δ x(nTs)−Δ− 2 Δ2 Δx∧(nTs)That is, 1 is assigned so as to cover the possible peak-to-peak range of values of the signal, or its
dynamic range. To each of the levels a binary code is assigned. The code assigned to each of the
levels uniquely represents the different levels [− 21 ,− 1 , 0, 1 ]. As to the way to approximate the
given sample to one of these levels, it can be done byroundingor bytruncating. The quantizer shown
in Figure 7.12 approximates by truncation—that is, if the samplek 1 ≤x(nTs) < (k+ 1 )1, fork=
−2,−1, 0, 1, then it is approximated by the levelk 1.To see the quantization, coding, and quantization error, let the sampled signal bex(nTs)=x(t)|t=nTSThe given four-level quantizer is such thatk 1 ≤x(nTs) < (k+ 1 )1 ⇒ ˆx(nTs)=k 1 k=−2,−1, 0, 1 (7.24)where the sampled signalx(nTs)is the input and the quantized signalxˆ(nTs)is the output. Therefore,− 21 ≤x(nTs) <− 1 ⇒ ˆx(nTs)=− 21
− 1 ≤x(nTs) < 0 ⇒ ˆx(nTs)=− 1
0 ≤x(nTs) < 1 ⇒ ˆx(nTs)= 0
1 ≤x(nTs) < 21 ⇒ ˆx(nTs)= 1To transform the quantized values into unique binary 2-bit values, one could use a code such asxˆ(nTs) = − 21 ⇒ 10
xˆ(nTs) = − 1 ⇒ 11
xˆ(nTs) = 01 ⇒ 00
xˆ(nTs) = 1 ⇒ 01which assigns a unique 2-bit binary number to each of the four quantization levels.If we define the quantization error asε(nTs)=x(nTs)−ˆx(nTs)