Académique Documents
Professionnel Documents
Culture Documents
Effects Effects
Ideally, the system parameters along with
the signal variables have infinite precision These nonlinear equations, in principle, are
taking any value between and almost impossible to analyze and deal with
In practice, they can take only discrete exactly
values within a specified range since the However, if the quantization amounts are
registers of the digital machine where they small compared to the values of signal
are stored are of finite length variables and filter parameters, a simpler
The discretization process results in approximate theory based on a statistical
nonlinear difference equations model can be applied
characterizing the discrete-time systems
1 Copyright 2005 S. K. Mitra 2 Copyright 2005 S. K. Mitra
1
Analysis of Finite Wordlength
Analysis of Finite Wordlength
Effects
Effects Arithmetic Quantization Error - For the
A/D Conversion Error - generated by the first-order digital filter, the desired output of
filter input quantization process the multiplier is
If the input sequence x[n] has been obtained v[n] = y[n 1]
by sampling an analog signal xa (t ), then the Due to product quantization, the actual
actual input to the digital filter is output of the multiplier of the implemented
x^[n] = x[n] + e[n] filter is
where e[n] is the A/D conversion error v^[n] = y[n 1] + e [n] = v[n] + e [n]
where e [n] is the product roundoff error
7 Copyright 2005 S. K. Mitra 8 Copyright 2005 S. K. Mitra
2
Quantization Process and Quantization Process and
Errors Errors
In DSP applications, it is a common practice
Since the number of all possible combinations to represent the data either as a fixed-point
of the type of arithmetic, type of quantization fraction or as a floating-point binary number
method, and digital filter structure is very with the mantissa as a binary fraction
large, quantization effects in some selected Assume the available wordlength is (b+1)
practical cases are discussed bits with the most significant bit (MSB)
Analysis presented can be extended easily to representing the sign
other cases Consider the data to be a (b+1)-bit fixed-
point fraction
13 Copyright 2005 S. K. Mitra 14 Copyright 2005 S. K. Mitra
3
Quantization of Fixed-Point Quantization of Fixed-Point
Numbers Numbers
Truncation of a (+1)-bit fixed-point
number to (b+1) bits is achieved by simply Range of truncation error t = Q ( x) x
discarding the least significant ( b) bits (assuming >> b):
as shown below Positive number and twos complement
21 22 2b 2 negative number
< t 0
s a1 a2 ab
Sign-magnitude negative number and ones-
To be discarded complement negative number
s a1 a2 ab 0 t <
19 Copyright 2005 S. K. Mitra 20 Copyright 2005 S. K. Mitra
Quantization of Floating-Point
Numbers Quantization of Floating-Point
The quantization of a floating-point number Numbers
is carried out only on the mantissa Sign-magnitude and oness complement
Range of relative error: truncation
2 < t 0
Q ( x) x Q ( M ) M
= = Rounding of all numbers
x M
Twos complement truncation < r
2 < t 0, x > 0 Note: We consider in this course fixed-
0 t < 2 , x < 0 point implementation case
23 Copyright 2005 S. K. Mitra 24 Copyright 2005 S. K. Mitra
4
Analysis of Coefficient Analysis of Coefficient
Quantization Effects Quantization Effects
The transfer function H ( z ) of the digital The actual frequency response H (e j ) is
filter implemented with quantized thus different from the desired frequency
coefficients is different from the desired response H (e j )
transfer function H(z) In some cases, the poles may move outside
Main effect of coefficient quantization is to the unit circle causing the implemented
move the poles and zeros to different digital filter to become unstable even
locations from the original desired locations though the original transfer function H(z) is
stable
25 Copyright 2005 S. K. Mitra 26 Copyright 2005 S. K. Mitra
Gain, dB
-4
-40
-6
-60
-8
-80 -10
0 0.2 0.4 0.6 0.8 1 0 0.1 0.2 0.3 0.4 0.5
/ /
27 Copyright 2005 S. K. Mitra 28 Copyright 2005 S. K. Mitra
0
0 -20
Gain, dB
Gain, dB
-0.5
-40 -1
-0.5
-1.5
-1 -60
-2
-1 -0.5 0 0.5 1 0 0.2 0.4 0.6 0.8 1 0 0.1 0.2 0.3 0.4 0.5
29 Real Part 30 / /
Copyright 2005 S. K. Mitra Copyright 2005 S. K. Mitra
5
Coefficient Quantization Effects
On A Direct Form FIR Filter
Estimation of Pole-Zero
Displacements
Gain responses of a 39-th order equiripple
lowpass FIR filter with unquantized and Consider an N-th degree polynomial B(z)
quantized coefficients with simple roots:
N N
Fullband Gain Response Passband details
B( z ) = bi z i = ( z zk )
original - solid line, quantized - dashed line
1
original - solid line, quantized - dashed line
i =0 k =1
0
0 with bN = 1
Gain, dB
Gain, dB
-20
-1
Roots zk of B(z) are given by
-40
zk = rk e j k
-2
-60 -3
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6
/ /
31 Copyright 2005 S. K. Mitra 32 Copyright 2005 S. K. Mitra
Estimation of Pole-Zero
Estimation of Pole-Zero
Displacements
Displacements
Effect of coefficient quantization is to
change the polynomial coefficient bi to zk denotes the roots of B ( z ) and are the
bi + bi new locations to which roots zk of B(z)
have moved
Thus, the polynomial B(z) after coefficient
quantization becomes For small changes in the coefficient values,
N zk will be close to zk and can be expressed
B ( z ) = (bi + bi ) z i as
i =0
N N zk = zk + zk = (rk + rk )e j ( k + k )
= B ( z ) + (bi ) z i = ( z zk )
i =0 k =1
33 Copyright 2005 S. K. Mitra 34 Copyright 2005 S. K. Mitra
6
Estimation of Pole-Zero Estimation of Pole-Zero
Displacements Displacements
If zk is very close to zk, then we can write Therefore
1 k N 1 N 1
zk = k ( bi )( zk )i k (bi )( zk )i
B( zk ) zk zk i =0 i =0
or assuming that zk is very close to zk
zk = k B ( zk )
Rewriting the above equation we get
But N 1
N 1 (rk + jrk k )e j k = ( Rk + jX k ) (bi )( zk )i
B ( zk ) = 0 = B ( zk ) + (bi )( zk )i i =0
i =0
37 Copyright 2005 S. K. Mitra 38 Copyright 2005 S. K. Mitra
Estimation of Pole-Zero
Displacements Estimation of Pole-Zero
Example - Consider the direct form II
Displacements
realization of Here B( z ) = z 2 K z + L = ( z z1)( z z2 )
z2 z2 where z1 = re j , z2 = re j
H ( z) = 2 =
z K z + L B( z ) We compute
z z1 j
1 = =
x[n] + y[n]
B( z ) z = z 2r sin
K z 1 Therefore 1
+ B = [L K ] T
z 1 Q1 = [ sin 0]
L
P1 = [cos r ]
41 Copyright 2005 S. K. Mitra 42 Copyright 2005 S. K. Mitra
7
Estimation of Pole-Zero Estimation of Pole-Zero
Displacements Displacements
Substituting these values we get Consider an arbitrary digital filter structure
with R multipliers given by
r = X1Q1B = 1 L
2r
L K k , k = 1, 2,K, R
= 1r ( X1P1B) = 2 The multiplier coefficients k are
2r tan 2 r sin
It can be seen that the 2nd-order direct form multilinear functions of the coefficients bi
IIR structure is highly sensitive to of the polynomial B(z)
coefficient quantizations for transfer
functions with poles close to = 0 or
43 Copyright 2005 S. K. Mitra 44 Copyright 2005 S. K. Mitra
Estimation of Pole-Zero
Estimation of Pole-Zero
Displacements
Displacements In matrix form we have B = C
Thus, when k changes into k + k due where
to coefficient quantization, the change bi b0 b0
L
b0
1 2 R
in the polynomial coefficient bi can be b
1 b1 b1
expressed as C = 1 2
L
R
R b M M
bi = i k , i = 1, 2,K, N 1 bN 1
M
bN 1
O
bN 1
k =1 k L
R
1 2
= [1 2 3 L R ]T
45 Copyright 2005 S. K. Mitra 46 Copyright 2005 S. K. Mitra
Estimation of Pole-Zero
Estimation of Pole-Zero Displacements
Displacements Example - Consider the coupled-form
Here the root displacements are given by structure with a transfer function given by
rk = Sbrk C z2
H ( z) = 2
k = Sbk C z ( + ) z + ( )
where the sensitivity vectors Sbk and Sbk
r
x[n] + + y[n]
are as given earlier
Note: The matrix C depends on the z 1 z 1
structure but has to be computed only once +
8
Estimation of Pole-Zero Estimation of Pole-Zero
Displacements Displacements
If = = r cos and = = r sin , Taking the partials of both sides of the last
then the transfer function becomes two equations we get
z2 L = 2r cos 2r sin
H ( z) = 2
z 2r cos z + r 2 K 2 0
Comparing the denominator of the above Finally, substituting the results of the
with that of the transfer function of the previous example we arrive at
direct form structure we get 1 0 2r cos 2r sin
K = + = 2 r = 2r
1
1
2 0
L = = 2 + 2 2 r 2 tan 2 r sin
49 Copyright 2005 S. K. Mitra 50 Copyright 2005 S. K. Mitra
9
Quantization Noise Model
Quantization Noise Model Input-output characteristic
The quantization process employed by the
quantizer can be either rounding or
truncation
Assuming rounding is used, the input-
output characteristic of a 3-bit A/D
converter with the output in twos-
complement form is as shown next
10
Quantization Noise Model Quantization Noise Model
It follows from the input-output In this case, the quantization error e[n],
characteristic of the 3-bit bipolar A/D called the granular noise, is bounded in
converter given earlier that e[n] is in the
magnitude according to < e[n]
range 2 2
< e[n] A plot of the e[n] of the 3-bit A/D converter
2 2
as a function of the input sample x[n] is
assuming that a sample exactly halfway
between two levels is rounded up to the shown below
nearest higher level and assuming that the
analog input is within the A/D converter
full-scale range
61 Copyright 2005 S. K. Mitra 62 Copyright 2005 S. K. Mitra
11
Quantization Noise Model Quantization Noise Model
The statistical model makes the analysis of
These assumptions hold in most practical A/D conversion noise more tractable and
situations for input signals whose samples results derived have been found to be useful
are large and change in amplitude very for most applications
rapidly in time relative to the quantization If ones-complement or sign-magnitude
step in a somewhat random fashion truncation is employed, the quantization
These assumptions have also been verified error is correlated to the input signal as the
experimentally and by computer sign of each error sample e[n] is exactly
simulations opposite to the sign of the corresponding
input sample x[n]
67 Copyright 2005 S. K. Mitra 68 Copyright 2005 S. K. Mitra
=
functions p(e) for rounding and twos- e2 =
2
12
Signal-to-Quantization Noise Signal-to-Quantization Noise
Ratio Ratio
Therefore SNR A / D = 10 log10 248 x2
2
For a given wordlength, the actual SNR
2 b
( R FS ) depends on x , the rms value of the input
= 6.02b + 16.81 20 log RFS
dB signal amplitude and the full-scale range RFS
x of the A/D converter
This expression can be used to determine
the minimum wordlength of an A/D Example - Determine the SNR in the digital
converter needed to meet a specified SNR A / D equivalent of an analog sample x[n] with a
zero-mean Gaussian distribution using a
Note: SNR A / D increases by 6 dB for each (b+1)-bit A/D converter having RFS = K x
bit added to the wordlength
73 Copyright 2005 S. K. Mitra 74 Copyright 2005 S. K. Mitra
13
Effect of Input Scaling on SNR Effect of Input Scaling on SNR
Consider the scaled input Ax[n]
But increasing A also increases the
The variance of the scaled input is A x
2 2
probability that some of the input analog
Then samples being outside the full-scale range
SNR A / D = 6.02b + 16.81 20 log10 ( K ) RFS and as result, the expression for SNR A / D
+ 20 log10 ( A) no longer holds
For a given b, the SNR can be increased by Moreover, the output is clipped, causing
scaling up the input signal by making A > 1 severe distortion in the digital
representation of the input analog signal
79 Copyright 2005 S. K. Mitra 80 Copyright 2005 S. K. Mitra
14
Propagation of Input Quantization
Propagation of Input Quantization
Noise to Digital Filter Output
Therefore
Noise to Digital Filter Output
The output noise power spectrum is given
v[n] = h[n] * e[n] = e[m]h[n m] by
m = 2
The mean mv of the output noise v[n] is Pvv ( ) = e2 H (e j )
given by The normalized output noise variance is
mv = me H (e j 0 )
given by
and its variance v2 is given by v2
j 2
v2,n = = 1
H (e ) d
e2 j 2 e2 2
v2 = ) d
2 H (e
85 Copyright 2005 S. K. Mitra 86 Copyright 2005 S. K. Mitra
15
Algebraic Computation of
Output Noise Variance Table of Typical Contour
In most practical cases, H(z) has only Integrals
simple poles with H k (z ) being either a 1st- H l ( z 1 )
order or a 2nd-order transfer function Bl Cl z 1 + Dl
H k ( z) A
Typical terms in the partial-fraction z 1 al z 2 + bl z 1 + d l
expansion of H(z) are: A I1 0 0
Bk Ck z + Dk Bk
z ak
0 I2 I 4'
A, ,
z ak z 2 + b z + d Ck z + Dk
k k 0 I4 I3
Let a typical contour integral be denoted as z 2 + bk z + d k
1 1 1
Ii = H k ( z ) H l ( z ) z dz
2 j
91
C 92
Copyright 2005 S. K. Mitra Copyright 2005 S. K. Mitra
16
Computation of Output Noise Computation of Output Noise
Variance Using MATLAB Variance Using MATLAB
In the MATLAB implementation of the An alternative fairly simple method of
algebraic method outlined earlier, the computation is based on the output noise
variance formula
partial-fraction expansion can be carried out
using the M-file residue v2,n = h[n] 2
n =
This results in terms of the form A and
Bk /( z ak ) where the residues Bk and the For a causal stable digital filter, the impulse
response decays rapidly to zero values
poles ak are either real or complex numbers
Hence we can write
For variance calculation, only the terms I1 L
and I 2 are then employed v2,n = S L h[n] 2
n =0
97 Copyright 2005 S. K. Mitra 98 Copyright 2005 S. K. Mitra
17