Академический Документы
Профессиональный Документы
Культура Документы
28.9.2004
Introduction
Analysis of Finite
Word-Length Effects
e1[n]
G1* ( z )
e j [n]
x[n]
G *j ( z )
F1* ( z ) H (z )
y[n]
v1*[n]
Fi * ( z )
vi*[n]
5
28.9.2004
H ( z) =
1
z
=
1 z 1 z
1
1 ' z 1
x'[n] = x[n] + e[n]
Rounding/truncation of v[n]:
Quantization of coefficients :
Fractional numbers
(sign bit + fractional
part)
The quantization
process model
H ' ( z) =
Error : = Q( x) x
Rounding /
Truncation:
2004 Olli Simula
Rounding
1
2
(2
r 12 (2 b 2 )
Twos complement
truncation
2 b 2 t 0
Quantization Error
2 b 2 t 0 for x > 0
for x < 0
9
Sign-magnitude and
ones complement
truncation
0 t 2 b 2
2004 Olli Simula
Error : e =
Q ( x) x Q ( M ) x
=
x
x
11
10
Analysis of Coefficient
Quantization Effects
The transfer function H ( z ) of the digital
filter implemented with quantized
coefficients is different from the desired
transfer function H(z)
Main effect of coefficient quantization is to
move the poles and zeros to different
locations from the original desired locations
2004 Olli Simula
12
Copyright 2001, S. K. Mitra
28.9.2004
Analysis of Coefficient
Quantization Effects
Analysis of Coefficient
Quantization Effects
13
14
Passband Details
original - solid line, quantized - dashed line
-20
-2
Gain, dB
Gain, dB
-40
-4
-6
-60
-80
-8
0
0.2
0.4
0.6
0.8
-10
0.1
0.2
0.3
0.4
1
Imaginary Part
0.5
0
-0.5
-1
-1
-0.5
0
0.5
Real Part
0.5
15
16
Passband Details
Passband details
original - solid line, quantized - dashed line
1
0
Gain, dB
-40
-0.5
-1
-1.5
-60
0
0.2
0.4
0.6
0.8
-2
0.1
0.2
0.3
0.4
0.5
17
Copyright 2001, S. K. Mitra
Gain, dB
-20
Gain, dB
Gain, dB
-20
-40
-60
-1
-2
-3
0.2
0.4
0.6
/
0.8
0.2
0.4
0.6
/
18
Copyright 2001, S. K. Mitra
28.9.2004
Amplitude responses
2004 Olli Simula
Pole-zero locations
19
Example:
Amplitude responses
2004 Olli Simula
Pole-zero locations
20
6th
order bandstop
filter with unquantized
coefficients
H ( z ) = h[n]z n
n =0
M 1
M 1
n=0
n =0
H(z)
+
E(z)
21
22
Analog input
Input analog
sample x[n]
Quantized
input sample
xeq [n] =
Binary equivalent
of quantized input
2 x[n]
RFS
RFS = 2b +1
Input signal is assumed to be scaled to be in the
range of +1 by dividing its amplitude by RFS/2
23
24
28.9.2004
Quantization Error
x[n ]
e[ n] = Q( x[n]) x[ n] = x[ n] x[n]
Assumptions:
2 < e[n] 2
e[n] is called
granular noise
Outside RFS the error increases linearly; e[n] is called
the saturation error or the overload noise
The output value is clipped to the maximum value
2004 Olli Simula
25
me =
e[n ]
26
Signal-to-Noise ratio
( / 2) ( / 2) = 0
2
(( / 2) ( / 2))2 = 2
e2 =
12
12
0
=
2
2
2
(
0 ) 2
2
e =
=
12
12
me =
(b) Twos
complement
truncation
1) The error sequence {e[n]} is a sample sequence of a widesense stationary (WSS) white noise process, with each sample
e[n] being uniformly distributed over the quantization error
2) The error sequence is uncorrelated with its corresponding input
sequence {x[n]}
3) The input sequence is a sample sequence of a stationary
random process
where
x2 is the signal variance (power) and
e2 is the noise variance (power)
27
Signal-to-Noise Ratio
2
12
R
= 6.02b + 16.81 - 20log10 FS
dB
28
2
2
2 2 ( b +1) RFS
2 2b RFS
=
12
48
48 2
SNR A / D = 10 log10 2b x2
2 RFS
A/D conversion:
(b+l) bits: = 2-(b+1)RFS , where RFS is the full-scale
range
e2 =
29
R
SNR A / D = 6.02b + 16.81 - 20log10 FS
A x
= 6.02b + 16.81 20 log10 ( K ) + 20 log10 ( A)
where RFS=Kx (x is the RMS value of the signal)
Scaling down the input signal (A<1) decreases the SNR
Scaling up the input signal (A>1) increases the possibility
to exceed the full-scale range RFS resulting in clipping SNR
2004 Olli Simula
30
28.9.2004
v2 =
e2
2
H (e
) d
Pvv2 ( ) = e2 H (e j )
e[m]h[n m]
v[n] =
mv = me H (e j 0 )
m =
2004 Olli Simula
31
32
v2 1
=
e2 2
which can be written as:
v2,n =
v2,n =
H (e
Analysis of
) d
1
H ( z ) H ( z 1 )z 1dz
2j C
v2,n =
2004 Olli Simula
h[n]
n =
33
Assumptions:
Quantization before
summation
The number of
multiplications kl at adder
inputs
The rth branch node with
signal value ur[n] needs
to be scaled to prevent
overflow
35
36
28.9.2004
fr[n]
Impulse response from
filter input to branch
node r
gl[n]
Impulse response from
input of lth adder to
filter output
2004 Olli Simula
37
l =1
1
2j C
Gl ( z )Gl ( z 1 ) z 1dz
l =1
n =0
vl [n]
[(
02 kl
G ( z)G ( z
1
2j C
)]
) z 1dz = 02 kl 21
G(e
2
) d
38
40
Digital filter
2 = 02 kl g l[n]
u r [n]
2 = 02 kl
41
42
28.9.2004
An Absolute Bound
An Absolute Bound
Assuming that x[n] satisfies the dynamic range
constraint |x[n]| < 1
Digital filter
u r [n] =
f r [n]
k =
43
f r [k ]
k =
45
1
u r [ n]
2
F (e
F (e
r
) X (e j )e jn d
) X ( e j ) d
Fr (e j )
2004 Olli Simula
X (e
X ( e j )
= max F (e j )
46
1
Fr (e j )
2
1
p
p
=
F (e j ) d
p
2
U r (e j ) = Fr (e j ) X (e j )
1
2
44
u r [ n] =
f r [k ] 1 for all r
f r [k ]
Scaling Norms
max
k =
K=
k =
f [k ]x[n k ]
k =
f [k ]x[n k ]
) d
47
48
28.9.2004
1
u r [ n] =
Fr (e j ) X (e j )e jn d
2
Applying Schwarz inequality
1
2
ur [n]
2
1
j 2
Fr (e ) d 2
u r [n] Fr (e j )
or equivalently
2
X (e j ) d
X ( e j )
If the filter input has finite energy bounded by unity, i.e., ||X||2 < 1,
then the adder overflow can be prevented by scaling the filter
such that the RMS value of the scaling transfer functions are
bounded by unity:
1, r = 1,2,..., R
49
i =1
where H i ( z ) =
Bi ( z ) 1 + b1i z 1 + b2i z 2
=
Ai ( z ) 1 + a1i z 1 + a2i z 2
K ' r 1
H 'l ( z) , r = 1,2,..., R
Ar ( z ) l =1
51
( 1 p )+ ( 1q ) = 1
F ' p 1, r = 1,2,..., R
50
Scaling - Back-Scaling
1
H ( z ) = K H i ( z ),
X (e j )
The nodes
(*) need to
be scaled
FILTER
H2(z)
2
R1
HR(z)
52
K r 1
H l ( z),
Ar ( z ) l =1
r = 1,2,..., R
R
H ( z ) = K H l ( z ),
l =1
1 + b1i z 1 + b2l z 2
where H l ( z ) =
1 + a1l z 1 + a2l z 2
53
28.9.2004
y2 = 02 kl
R
Gl ( z ) = K H i ( z ) = i Gl ( z ) , l = 1,2,..., R ; and GR +1 ( z ) = 1
i =l
i =l
55
59
G (e
2
2
R +1
) d = 02 kl Gl 2
l =1
56
i =l
Fl
l
=
R +1 H
p
p
02
k R +1 H
R +1
+ kl Fl
l =1
2
Gl (e j )
y =
2004 Olli Simula
02
k R +1 H
R +1
+ kl Fl
l =1
2
p
2
Gl 2
58
60
10
28.9.2004
Section Ordering
Section Ordering
A section in the front part of the cascade has its
transfer function Hi(z) appearing more frequently in
the scaling transfer functions
A section near the output end of the cascade has its
transfer function Hi(z) appearing more frequently in
the noise transfer function expressions
=>
61
L2 scaling:
The ordering of paired sections does not influence too much
the output noise power since all norms in the expressions are
L2-norms
L scaling:
The sections with poles closest to the unit circle exhibit a
peaking magnitude response and should be placed closer to
the output end
=> The ordering should be from least-peaked to most-peaked
On the other hand, the ordering scheme is exactly opposite if
the objective is to minimize the peak noise ||Pyy()|| and L2scaling is used
The ordering has no effect on the peak noise with L-scaling
2004 Olli Simula
62
63
64
e[n] = y[n] w[ n]
Substituting w[n]:
ae[n 1] be[n 2]
Total error between
output and input is still:
e[n] = y[n] x[n]
Y ( z ) X ( z ) = E ( z ) + az 1 E ( z ) + bz 2 E ( z )
= 1 + az 1 + bz 2 E ( z ) = G ( z ) E ( z )
where G(z) is the error shaping transfer function
65
66
11
28.9.2004
(
= (1 2 z
G ( z ) = 1 + az 1 + bz 2
1
+z
) = (1 z )
1 2
67
12