SQNR
SQNR
SQNR
The simplest method of quantisation is to divide the full range of input signal
values, from −C to +C, into N
equal intervals, as shown in Figure 10.2. Note that there are N/2 intervals
(indexed L =0, 1, 2, …, N/2−1) in the
positive range and N/2 intervals in the negative range (also indexed L =0, 1, 2, …,
N/2−1) and zero is an interval
boundary, so this is a midrise quantisation scheme. Furthermore, all input samples
falling within a given interval
are approximated or quantised to the midpoint of that interval, making this a
rounding quantiser. Figure 10.2 thus
represents a midrise rounding uniform quantisation scheme.
–C
C
Input, x
0
Δ
s
0
eq
Quantised output, yL
yN/2 – 1 = (N – 1)Δ/2
yj
= (2j + 1)Δ/2
Quantisation index,
L = 0, 1, 2, …, N/2 – 1
C – Δ
–Δ
Δ
y1 = 3Δ/2
y0 = Δ/2
–y0
–y1
–yj
–yN/2 – 1
Δ/2
Δ
Figure 10.2 Midrise rounding uniform quantisation.
10.3 Uniform Quantisation 635
Table 10.3 Choosing N =8 intervals uses all 3-bit binary codewords.
Quantisation
interval 0 1 2 3 4 5 6 7
Binary
codeword
000 001 010 011 100 101 110 111
← Not used if N =5 →
The number of intervals is usually chosen to be an integer power of 2
N = 2k; ⇒ k = log2N (10.6)
This choice allows the k-bit binary codes to be fully utilised at the coding stage
of the ADC process to represent
the N intervals. For example, if we choose N =5 then we require k =3 bits to
represent these five intervals. See
Table 10.3, where, for convenience, the intervals have been unidirectionally
indexed from 0 to N −1 (instead of
the usual bidirectional indexing from 0 to N/2−1 for the positive range and 0 to
N/2−1 for the negative range).
Notice how the codes 101, 110, and 111 are surplus to requirement if N =5.
It is shown below that quantisation noise is reduced as N increases. In this
example therefore, we can reduce
quantisation noise at no extra cost (i.e. without increasing the number of bits k
required to represent each quantisation interval) simply by increasing N from 5 to
23 =8.
10.3.1 Quantisation Noise
In a uniform or linear quantisation, all intervals are of an equal size Δ, called
the quantiser step size. And in a
rounding quantiser, the quantised value of each interval is set to the average of
all input samples that fall in that
interval. If the samples in each interval are equally likely to be located anywhere
within the interval, this average
and hence quantised value will be the midpoint of the interval. Each sample is
therefore approximated to the
midpoint of the interval in which it falls. For example, any sample of value in the
range 0 to Δ (which is the zeroth
positive quantisation interval with index L =0) is quantised to y0 = Δ/2; any
sample in the range 0 to −Δ (which
is the zeroth negative quantisation interval) is quantised to −y0; any sample in
the topmost interval (C, C−Δ), of
index L = N/2−1, is quantised to (N −1)Δ/2; and in general any sample in the j
th positive quantisation interval
is quantised to yj =(2j +1)Δ/2. Therefore, for each sample of value s in the j
th interval, quantisation produces an
error given by
eq = |s − yj
| (10.7)
This error has a maximum value eq max when sis either by the top or by the bottom
of the interval, i.e.s = yj ± Δ/2.
Thus
eq max = |yj ± Δ∕2 − yj
| = Δ∕2 (10.8)
The maximum possible error incurred in each quantisation is therefore half the
quantiser step size.
As discussed in Section 3.5.2, the mean square value of a signal gives its
(normalised) power. Therefore, to
determine quantisation noise power, we need to calculate the MSQE across all the
samples of the signal. However,
if the input signal lies entirely within the quantiser range, i.e. it does not
overload the quantiser, the error statistics
are the same across all the uniform quantiser intervals spanned by the input.
Therefore, we may focus on the
bottom positive interval (shown blown out on the right-hand side of Figure 10.2)
and sum over the entire interval
(0 → Δ) the product of e2
q = (s − Δ∕2)
2 and the probability ds/Δ that the sample s lies in an infinitesimal interval
636 10 Digital Baseband Coding
ds around s. This gives
MSQE = ∫
Δ
0
e2
qds∕Δ = 1
Δ ∫
Δ
0
(s − Δ∕2)
2
ds = 1
Δ ∫
Δ
0
(s
2 − sΔ+Δ2
∕4)ds
= 1
Δ
[(s3
3 − s2Δ
2
+
sΔ2
4
)|
|
|
|
|
Δ
0
]
= 1
Δ
(Δ3
3 − Δ3
2
+
Δ3
4
)
= 4Δ2
12 − 6Δ2
12
+
3Δ2
12
Therefore
MSQE = Δ2
12 (10.9)
We see that the MSQE depends only on the step size Δ. This error will appear as
noise associated with the signal.
The main advantage of this quantisation process is that if we can somehow convey
the information about each
quantised level without error then we will introduce no further degradation to the
signal. We can therefore make
this quantisation noise as small as we wish by sufficiently reducing Δ. However,
there is a price to pay for this
improved noise performance. From Figure 10.2 and Eq. (10.6) it follows that
Δ = 2C
N = 2C
2k (10.10)
Here, k is the number of bits required to represent each quantised level, i.e. the
number of bits per sample. Thus,
Δ and hence quantisation noise can be reduced by increasing the number of bits per
sample. This increases the bit
rate and hence the bandwidth required for transmission.
10.3.2 Dynamic Range of a Quantiser
A sinusoidal input signal of amplitude Vmax = C will fully load the quantiser in
Figure 10.2, since it has values that
cover the entire range from −C to +C. Sinusoids of a larger amplitude would cause
clipping and distortion. On the
other hand, the variations of a sinusoidal input signal of amplitude Vmin = Δ/2 are
confined to a single interval
of the quantiser. In other words, variations in this sinusoid will go undetected at
the quantiser output. The ratio
of the largest amplitude Vmax of a sinusoid that avoids clipping to the largest
amplitude Vmin of a sinusoid whose
variations go undetected is called the dynamic range of the quantiser
Dynamic Range = Vmax
Vmin
= C
Δ∕2 = 2k
= 6.02k dB (10.11)
The dynamic range therefore depends on the number of bits per sample. It increases
by 6 dB for each extra bit
available for representing each sample.
10.3.3 Signal-to-quantisation-noise Ratio (SQNR)
An important parameter for assessing the performance of the quantiser is the ratio
of signal power to quantisation noise power, called the signal-to-quantisation-
peak-to-rms ratio of the signal to be quantised. For a signal of rms = 𝜎, and peak
noise ratio (SQNR). Let us define a parameter R known as the
value Vp
𝜎 ; Signal Power = 𝜎2 = V2
R = Vp
p
R2
10.3 Uniform Quantisation 637
SQNR = Signal Power
MSQE = V2
p ∕R2
Δ2∕12 = 12 × 22kVp
2
4C2R2
= 3Vp
2
C2R2 22k (10.12)
where we have made use of the expression for Δ in Eq. (10.10). Expressing Eq.
(10.12) in dB
SQNR = 10log10 [ 3V2
p
C2R2 22k
]
= 10log10(3) + 10log10(22k) + 10log10(R−2
) + 10log10(Vp
2
∕C2
)
= 4.77 + 6.02k − 20log10(R) + 20log10(Vp∕C) dB (10.13)
If the signal fully loads the quantiser, Vp = C, and the SQNR improves to
SQNR = 4.77 + 6.02 k − 20log(R) (10.14)
Worked Example 10.2
Determine the SQNR as a function of number of bits/sample for each of the following
signals:
(a) Sinusoidal signal.
(b) Signal with a uniform probability density function (PDF).
(c) Speech signal.
(𝜔t)dt
sin2
= C2
2T ∫
T
(1 − cos 2𝜔t)dt
0
= C2
2
𝜎 = C
R = Peak value
C∕
√
2
=
√
2
It follows from Eq. (10.14) that
SQNR = 4.77 + 6.02k − 20 log(
√
2)
= 1.76 + 6.02k dB (10.15)
(b) The samples of this signal can take on any value between a minimum −C and a
maximum +C with equal
probability. It is assumed that the signal fully loads the quantiser. The
probability that a sample of the signal
lies between s − ds/2 and s + ds/2 is given by the shaded area pds in Figure 10.3.
Since each sample must lie
is obtained by summing (over the entire signal range −C to +C) the product of the
square of the sample value
s and the probability pds that a sample lies within the infinitesimal interval
𝜎2 = ∫
centred on s
+C
−C
s
2
pds = 1
2C ∫
+C
−C
s
2
ds = C2
3
638 10 Digital Baseband Coding
+C
PDF
p
Sample value
s
ds
–C
Figure 10.3 Worked Example 10.2: uniform probability density function (PDF).
Thus
𝜎 = C
R = Peak
C∕
√
3
=
√
3.
Eq. (10.14) then yields
SQNR = 6.02 k (10.16)
(c) Measurements show that speech signals have on average 20log(R) = 9 dB. Thus, if
the speech signal fully loads
the quantiser (i.e. peak value Vp = C) then it follows from Eq. (10.14) that
SQNR = 6.02 k − 4.23 dB (10.17)
Worked Example 10.3
A speech signal is to be transmitted by PCM with an output SQNR of 55 dB.
(a) What is the minimum number of bits per sample that must be used to achieve this
performance, if the
speech signal fully loads the quantiser?
(b) If the quantiser is only half-loaded by the speech signal, what is the
resulting output SQNR for the same
number of bits/sample as above?
(a) The required bits/sample is obtained by rewriting Eq. (10.17) to make k the
subject
k = SQNR + 4.23
6.02 = 55 + 4.23
6.02 = 9.84.
The smallest integer larger than or equal to the above result gives the minimum
number of bits/sample: k =10.
(b) The full expression for SQNR in Eq. (10.13) must be used in this case, with
20log(R) = 9 and Vp/C = 1
2
SQNR = 4.77 + 6.02k − 9 + 20 log (1
2
)
= 4.77 + 6.02 × 10 − 9 − 6.02
= 50 dB
Note how the SQNR degrades when the quantiser is underloaded by a small input
signal. Overloading, on the
other hand, leads to clipping. Optimum performance is obtained by scaling the
signal prior to quantisation to
ensure that it just fully loads the quantiser.
10.3 Uniform Quantisation 639
Input analogue signal
Quantised output
Codewords of quantised outputs
Error
111
110
101
100
000
001
010
011
Ts = 1/Fs
Figure 10.4 Eight-level uniform quantisation.
A demonstration of a combined process of sampling and uniform quantisation of a
sinusoidal signal is shown in
Figure 10.4. There are eight quantiser output levels, requiring k =3 bits to
represent each output level. The input
signal is scaled prior to sampling in order to fully load the quantiser. The bottom
plot of Figure 10.4 shows the
quantisation error, which is the difference between the quantised output and the
analogue input signal. At each
sampling instant the value of the analogue signal sample is approximated to the
midpoint of the quantisation
interval in which it lies. This quantised value is then held until the next
sampling instant. The result is a staircase
output signal.
10.3.4 Design Considerations
Several important PCM system design considerations may be deduced from the
relationships between the design
parameters in Eqs. (10.12) and (10.13).
● SQNR increases exponentially with the number of bits per sample k, which is
itself directly proportional to the
bandwidth B required to transmit the PCM signal. Thus, PCM provides an exponential
increase of SQNR with
bandwidth. This is a better bandwidth for noise improvement trade-off than offered
by frequency modulation
(FM), where signal-to-noise ratio (SNR) increases roughly as the square of
bandwidth. That is, if the SNR is
SNR1 at bandwidth B1, and the bandwidth is increased by a factor n to nB1, then the
SNR increases to n2 × SNR1
in FM, but more dramatically to SNRn
1 in PCM.
● More simply put, you make a gain of 6.02 dB per extra bit used for coding each
sample in PCM, but you generate more bits per second as a result, and therefore
require a larger transmission bandwidth. The number of
bits/sample required for a desired SQNR can be read from Figure 10.5 for the three
signals discussed in Worked
Example 10.2.
● SQNR decreases as the square of the quantiser range 2C needed to accommodate the
input signals without
clipping. An improvement in SQNR can therefore be realised by reducing the range of
input signal values. Some
differential quantisers achieve such gains by quantising the difference between
adjacent samples, rather than
the samples themselves. If the sampling rate is sufficiently high, adjacent samples
are strongly correlated and
the difference between them is very small, resulting in a reduced range of
quantiser input values.
640 10 Digital Baseband Coding
5 6 7 8 9 10 11 12
Number of bits/sample, k
25
30
40
50
60
70
75
SQNR (dB)
35
45
55
65
Sinusoid
Uniform PDF
Speech
Figure 10.5 SQNR of a uniform quantiser as a function of number of bits/sample for
various signal types.
● A large segment of the quantisation error signal resembles a sawtooth waveform
with a fundamental frequency
that increases with the sampling frequency Fs. Thus, oversampling an analogue
signal (i.e. choosing a much
higher value of Fs than required by the sampling theorem) will have the effect of
spreading out the quantisation
noise power over a wider frequency band. As a result, only a significantly reduced
fraction of the noise lies
within the signal band at the reconstruction filter.
● When an input signal underloads the quantiser, SQNR decreases by 20log(r) dB,
where r is the ratio between
the quantiser range 2C and the peak-to-peak value of the input signal. More simply
put, a signal that is at r dB
below the level that fully loads the quantiser will have an SQNR that isr dB worse
than the values obtained from
Figure 10.5. In speech communication, for example, this would mean a good SQNR for
the loudest speakers and
a significant degradation for soft speakers.