Vous êtes sur la page 1sur 17

Analysis of Finite Wordlength Analysis of Finite Wordlength

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

Analysis of Finite Wordlength Analysis of Finite Wordlength


Effects Effects
Using the statistical model, it is possible to Consider the first-order IIR digital filter
derive the effects of discretization and y[n] = y[n 1] + x[n]
develop results that can be verified
experimentally where y[n] is the output signal and x[n] is
Sources of errors - the input signal
(1) Filter coefficient quantization When implemented on a digital machine,
(2) A/D conversion the filter coefficient can assume only
(3) Quantization of arithmetic operations certain discrete values ^ approximating the

original design value


(4) Limit cycles
3 Copyright 2005 S. K. Mitra 4 Copyright 2005 S. K. Mitra

Analysis of Finite Wordlength


Analysis of Finite Wordlength
Effects
Effects
The desired transfer function is
Thus, the actual frequency response may be
H ( z ) = 1 1 = z z quite different from the desired frequency
1z
response
The actual transfer function implemented is
Coefficient quantization problem is similar
^
H ( z) = z
z ^ to the sensitivity problem encountered in
analog filter implementation
which may be much different from the
desired transfer function H(z)
5 Copyright 2005 S. K. Mitra 6 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

Quantization Process and


Analysis of Finite Wordlength
Effects Errors
Two basic types of binary representations of
Limit Cycles - The nonlinearity of the
data: (1) Fixed-point, and (2) Floating-point
arithmetic quantization process may
formats
manifest in the form of oscillations at the
filter output, usually in the absence of input Various problems can arise in the digital
or, sometimes, in the presence of constant implementation of the arithmetic operations
input signals or sinusoidal input signals involving the binary data
Caused by the finite wordlength limitations
of the registers storing the data and the
results of arithmetic operations
9 Copyright 2005 S. K. Mitra 10 Copyright 2005 S. K. Mitra

Quantization Process and Quantization Process and


Errors Errors
For example in fixed-point arithmetic, In both fixed-point and floating-point
product of two b-bit numbers is 2b bits formats, a negative number can be
long, which has to be quantized to b bits to represented in one of three different forms
fit the prescribed wordlength of the registers Analysis of various quantization effects on
In fixed-point arithmetic, addition operation the performance of a digital filter depends on
can result in a sum exeeding the register (1) Data format (fixed-point or floating-point),
wordlength, causing an overflow (2) Type of representation of negative numbers,
In floating-point arithmetic, there is no (3) Type of quantization, and
overflow, but results of both addition and (4) Digital filter structure implementing the transfer
multiplication may have to be quantized function
11 Copyright 2005 S. K. Mitra 12 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

Quantization Process and Quantization Process and


Errors Errors
Representation of a general (b+1)-bit fixed- Decimal equivalent of smallest positive
point fraction is shown below number is = 2b
21 22 2b Numbers represented with (b+1) bits are
thus quantized in steps of 2b, called
s a1 a 2 ab quantization step
An original data x represented as a (+1)-bit
Smallest positive number that can be fraction is converted into a (b+1)-bit
represented in this format will have a least fraction Q(x) either by truncation or
significant bit (LSB) of 1 with remaining rounding
bits being all 0s
15 Copyright 2005 S. K. Mitra 16 Copyright 2005 S. K. Mitra

Quantization Process and Quantization Process and


Errors Errors
The quantization process for truncation or
Since representation of a positive binary
rounding can be modeled as shown below
fraction is the same independent of format
being used to represent the negative binary
fraction, effect of quantization of a positive
x Q Q(x) fraction remains unchanged
The effect of quantization on negative
fractions is different for the three different
representations
17 Copyright 2005 S. K. Mitra 18 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 Fixed-Point Quantization of Floating-Point


Numbers Numbers
In floating-point format a decimal number x
Range of rounding error r = Q ( x) x is represented as x = 2 E M where E is the
(assuming >> b): exponent and M is the mantissa
For all positive and negative numbers Mantissa M is a binary fraction restricted to
< r lie in the range
2 2 1 M <1
2
Exponent E is either a positive or a negative
binary number
21 Copyright 2005 S. K. Mitra 22 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

Coefficient Quantization Effects


Analysis of Coefficient On a Direct Form IIR Filter
Quantization Effects Gain responses of a 5-th order elliptic
Effect of coefficient quantization can be lowpass filter with unquantized and
easily carried out using MATLAB quantized coefficients
To this end, the M-files a2dT (for Fullband Gain Response Passband Details
original - solid line, quantized - dashed line original - solid line, quantized - dashed line
truncation) and a2dR (for rounding) can be 0 0
used -20 -2
Gain, dB

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

Coefficient Quantization Effects Coefficient Quantization Effects


On a Direct Form IIR Filter On a Cascade Form IIR Filter
Pole and zero locations of the filter with Gain responses of a 5-th order elliptic
quantized coefficients (denoted by x and lowpass filter implemented in a cascade
o) and those of the filter with unquantized form with unquantized and quantized
coefficients (denoted by + and *) coefficients
Fullband Gain Response Passband Details
1
original - solid line, quantized - dashed line original - solid line, quantized - dashed line
0.5
0.5 0
Imaginary Part

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

Estimation of Pole-Zero Estimation of Pole-Zero


Displacements Displacements
If bi is assumed to be very small, we can Now we can express 1/B(z) by partial-
express fraction expansion as
zk = (rk + rk )e j k e j k (rk + rk )(1 + j k )e j k 1 N
= k
rk e j k + (rk + jrk k )e j k B( z ) k =1 z zk
neglecting higher order terms where k is the residue of 1/B(z) at the
Then pole z = zk , i.e.,
zk = zk zk ( rk + jrk k )e j k ( z zk )
k = = Rk + jX k
B( z ) z = z
k
35 Copyright 2005 S. K. Mitra 36 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 Estimation of Pole-Zero


Displacements Displacements
Equating real and imaginary parts of the The sensitivity vectors Sbrk and Sbk depend
above we arrive at only on B(z) and are independent of B
r
rk = ( Rk Pk + X k Q k ) B = S bk B Once these vectors have been calculated,

k = r1 ( X k Pk + Rk Q k ) B = Sbk B pole-zero displacements for any sets of B
k
where can be calculated using the equations given
Pk = [cos k rk rk2 cos k L rkN 1 cos( N 2) k ]
Elements of B are multiplier coefficient
changes only for the direct form realizations
Q k = [ sin k 0 rk2 sin k L rkN 1 sin( N 2) k ]
B = [b0 b1 b2 L bN 1 ]T
39 Copyright 2005 S. K. Mitra 40 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 +

47 Copyright 2005 S. K. Mitra 48 Copyright 2005 S. K. Mitra

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

Estimation of Pole-Zero A/D Conversion Noise


Displacements Analysis
or, A/D converters used for digital processing
r = cos sin of analog signals in general employ twos-
1r sin 1 cos
r
complement fixed-point representation to
represent the digital equivalent of the input
As can be seen from the above, the coupled- analog signal
form structure is less sensitive to multiplier For the processing of bipolar analog signals,
coefficient quantization than the direct form the A/D converter generates a bipolar
structure output represented as a fixed-point signed
binary fraction
51 Copyright 2005 S. K. Mitra 52 Copyright 2005 S. K. Mitra

Quantization Noise Model Quantization Noise Model


The dynamic range of the output register
The digital sample generated by the A/D depends on the binary number
converter is the binary representation of the representation selected for the A/D
quantized version of that produced by an converter
ideal sampler with infinite precision The model of a practical A/D conversion
If the output word is of length (b+1) bits system is as shown below
including the sign bit, the total number of xa (t ) Ideal x[n] x[n] xeq [n]
discrete levels available for the sampler = xa (nT ) Quantizer Coder
=Q ( x[ n ])
representation of the digital equivalent is 2b+1
53 Copyright 2005 S. K. Mitra 54 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

55 Copyright 2005 S. K. Mitra 56 Copyright 2005 S. K. Mitra

Quantization Noise Model Quantization Noise Model


The binary equivalent xeq [n] of the quantized Assume the input signal has been scaled to
input analog sample x[n] for a twos- be in the range of 1 by dividing its
complement binary representation, is a binary
amplitude by RFS / 2 , as is usually the case
fraction in the range
1 xeq [n] < 1 The decimal equivalent of xeq [n] is then
equal to x[n]
It is related to the quantized sample x[n]
through 2 x[n] For a (b+1)-bit bipolar A/D converter, the
xeq [n] = total number of quantization levels is 2b+1
RFS
where RFS denotes the full-scale range of the The full-scale range is RFS = 2b +1
A/D converter where is the quantization step size
57 Copyright 2005 S. K. Mitra 58 Copyright 2005 S. K. Mitra

Quantization Noise Model Quantization Noise Model


For the 3-bit bipolar A/D converter, total In general, for a (b+1)-bit bipolar A/D
number of levels is 23 = 8 converter employing twos-complement
The full-scale range is RFS = 8 with a representation, the full-scale range is given
maximum value of Amax = 7 / 2 and a by
minimum value of Amin = 9 / 2 (2b +1 + 1) < xa (nT ) ( 2b+1 1)
2 2
If the input analog sample xa (nT ) is within Denote the difference between the
the full-scale range quantized value Q ( x[n]) = x[n] and the input
9 < xa (nT ) 7 sample x[n] as the quantization error:
2 2
it is quantized to one of the 8 discrete levels e[ n] = Q ( x[n]) x[n] = x[n] x[n]
shown earlier
59 Copyright 2005 S. K. Mitra 60 Copyright 2005 S. K. Mitra

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

Quantization Noise Model Quantization Noise Model


When the input analog sample is outside the A clipping of the A/D converter output
full-scale range of the A/D converter, the causes signal distortion with highly
magnitude of error e[n] increases linearly undesirable effects and must be avoided by
with an increase in the magnitude of the scaling down the input analog signal xa (nT )
input
to ensure that it remains within the A/D
In such a situation, the error e[n] is called converter full-scale range
the saturation noise or the overload noise
as the A/D converter output is clipped to We therefore assume that input analog
the maximum value 1 2b if the analog samples are within the A/D converter full-
input is positive or to the minimum value scale range and thus, there is no saturation
1 if the analog input is negative error
63 Copyright 2005 S. K. Mitra 64 Copyright 2005 S. K. Mitra

Quantization Noise Model Quantization Noise Model


For simplified analysis, the following
Now, the input-output characteristic of an assumptions are made:
A/D converter is nonlinear, and the analog
(1) The error sequence {e[n]} is a sample
input signal is not known a priori in most
sequence of a wide-sense stationary (WSS)
cases
white noise process, with each sample e[n]
It is thus reasonable to assume for analysis being uniformly distributed over the range
purposes that the error e[n] is a random of the quantization error
signal with a statistical model as shown
(2) The error sequence is uncorrelated with
below
x[n] + x[n] its corresponding input sequence {x[n]}
(3) The input sequence is a sample sequence
e[n] of a stationary random process
65 Copyright 2005 S. K. Mitra 66 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

Quantization Noise Model Quantization Noise Model


As a result, practical A/D converters use Mean and variance of the error sample e[n]:
either rounding or twos-complement Rounding -
truncation
me = ( / 2) ( / 2) = 0
Quantization error probability density 2
( ( / 2) ( / 2) )
2

=
functions p(e) for rounding and twos- e2 =
2

complement truncation are as shown below 12 12


p(e) p(e) Twos-complement truncation -
1/
1/
me = 0 =
2 2
e2 = (0 ) =
e 2 2
/2 0 /2
e
0
Rounding Twos-complement truncation 12 12
69 Copyright 2005 S. K. Mitra 70 Copyright 2005 S. K. Mitra

Signal-to-Quantization Noise Signal-to-Quantization Noise


Ratio Ratio
The effect of the additive quantization noise For rounding, e[n] is uniformly distributed
e[n] on the input signal x[n] is given by the in the range ( / 2, / 2)
signal-to-quantization noise ratio given by
For twos-complement truncation, e[n] is
2 uniformly distributed in the range ( ,0)
SNR A / D = 10 log10 x2 dB
e For a bipolar (b+1)-bit A/D converter
where x2 is the input signal variance = 2(b +1) RFS
representing the signal power and e2 is
Hence 2 2b ( RFS ) 2
the noise variance representing the e2 =
quantization noise power 48
71 Copyright 2005 S. K. Mitra 72 Copyright 2005 S. K. Mitra

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

Signal-to-Quantization Noise Signal-to-Quantization Noise


Ratio Ratio
Here The probability of a particular input analog
SNR A / D = 6.02b + 16.81 20 log10 RFS sample with a zero-mean Gaussian
x
= 6.02b + 16.81 20 log10 ( K ) distribution staying within the full-scale
range 2 Kx is given by
Computed values of the SNR for various
values of K are as given below: K 2 /2
b=7 b=9 b = 11 b = 13 b = 15 2 (k ) 1 = 2 e y dy
K = 4 46.91 58.95 70.99 83.04 95.08 0
K = 6 43.39 55.43 67.47 79.51 91.56
K = 8 40.89 52.93 64.97 77.01 89.05
75 Copyright 2005 S. K. Mitra 76 Copyright 2005 S. K. Mitra

Signal-to-Quantization Noise Signal-to-Quantization Noise


Ratio
Ratio
For K = 6, the probability of an analog
Thus, for K = 4, the probability of an analog sample staying within the full-scale range
sample staying within the full-scale range 8 x 12 x is 0.9974
is 0.9544
On average about 26 samples out of
On average about 456 samples out 10,000 samples will fall outside the full-
of 10,000 samples will fall outside the full- scale range and be clipped
scale range and be clipped
In most applications, a full-scale range of
16x is more than adequate to ensure no
clipping in conversion
77 Copyright 2005 S. K. Mitra 78 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

Propagation of Input Quantization


Effect of Input Scaling on SNR
Noise to Digital Filter Output
A scaling down of the input analog signal To determine the propagation of input
by choosing A < 1 decreases the SNR quantization noise to the digital filter
It is therefore necessary to ensure that the output, we assume that the digital filter is
input analog sample range matches as close implemented using infinite precision
as possible to the full-scale range of the In practice, the quantization of arithmetic
A/D converter to get the maximum possible operations generates errors inside the digital
SNR without any signal distortion filter structure, which also propagate to the
output and appear as noise
81 Copyright 2005 S. K. Mitra 82 Copyright 2005 S. K. Mitra

Propagation of Input Quantization


Noise to Digital Filter Output Propagation of Input Quantization
Noise to Digital Filter Output
The internal noise sources are assumed to
be independent of the input quantization Because of the linearity property of the
noise and their effects can be analyzed digital filter and the assumption that x[n]
separately and added to that due to the input and e[n] are uncorrelated, the output y[n] of
noise the LTI system can thus expressed as
Model for the analysis of input quantization y[n] = y[ n] + v[n]
noise: where y[n] is the output generated by the
x[n]
x[n] + H ( z) y[n] unquantized input x[n] and v[n] is the output
= y[ n] + v[n] generated by the error sequence e[n]
e[n]
83 Copyright 2005 S. K. Mitra 84 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

Propagation of Input Quantization Algebraic Computation of


Noise to Digital Filter Output Output Noise Variance
In general, H(z) is a causal stable real
Alternately, rational function with all poles inside the
H ( z ) H ( z 1 ) z 1dz
1
v2,n = unit circle in the z-plane
2 j
C It can be expressed in a partial-fraction
where C is a counterclockwise contour in
the ROC of H ( z ) H ( z 1 ) expansion form
R
An equivalent expression for the normalized H ( z) = Hi ( z)
output noise variance is i =1

v2,n = h[n]
2 where H i (z ) is a low-order causal stable
n = real rational transfer function
87 Copyright 2005 S. K. Mitra 88 Copyright 2005 S. K. Mitra

Algebraic Computation of Algebraic Computation of


Output Noise Variance Output Noise Variance
Substituting the partial-fraction expansion Since H k (z ) and H l (z ) are stable transfer
of H(z) in functions, it can be shown that
1 1 1 1
H ( z ) H ( z 1 ) z 1dz H k ( z ) H l ( z ) z dz = H l ( z ) H k ( z ) z dz
1
v2,n =
2 j
C C C
Thus, we can write
we arrive at
v2,n = 1 R 1 1
R R 1 1 2 j
H k ( z ) H k ( z ) z dz
v2,n
1
= H k ( z ) H l ( z ) z dz k =1 C
2 j R 1 R
k = 1 l = 1C +
2
2 j
H k ( z ) H l ( z 1) z 1dz

89 Copyright 2005 S. K. Mitra 90 k =1 l = k +1C 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

Table of Typical Contour Algebraic Computation of


Integrals Output Noise Variance
where Example - Consider a first-order digital
I1 = A 2 filter with a transfer function
BB 1
I2 = k l
1 ak al H ( z) = = z
1 z
(Ck Cl + Dk Dl )(1 d k d l ) (Cl Dk DlCk d k )bl
1z
(Ck Dl Dk Cl d l )bk A partial-fraction expansion of H(z) is
I3 =
(1 d k d l ) 2 + d k bl2 + d lbk2 (1 + d k d l )bk bl
H ( z) = 1 + z

B (C + Dk al )
I4 = l k
1 + bk al + d k al2 The two terms in the above expansion are
B (C + Dl ak )
I 4' = k l H1( z ) = 1, H 2 ( z ) = z
1 + bl ak + d l ak2
93 Copyright 2005 S. K. Mitra 94 Copyright 2005 S. K. Mitra

Algebraic Computation of Algebraic Computation of


Output Noise Variance
Output Noise Variance
Therefore, the normalized output noise
variance is given by Thus, as the pole gets closer to the unit
2 1 circle, the output noise increases rapidly to
v2,n = 1 + = very high values approaching infinity
1 2
1 2
If the pole is close to the unit circle, we can For high-Q realizations, the wordlengths of
write = 1 , where 0 the registers storing the signal variables
In which case should be of longer length to keep the
1 1 round-off noise below a prescribed level
v2,n =
1 (1 ) 2 2
95 Copyright 2005 S. K. Mitra 96 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

Computation of Output Noise


Variance Using MATLAB
To determine an approximate value of v2,n
the sum S L is computed for L = 1, 2, . . ,
and the computation is stopped when
S L S L 1 <
where is a specified small number, which
is typically chosen as 106

99 Copyright 2005 S. K. Mitra

17

Vous aimerez peut-être aussi