Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction...

46
Chapter 11: Scaling and Round-off Noise Keshab K. Parhi

Transcript of Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction...

Page 1: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11: Scaling and Round-off Noise

Keshab K. Parhi

Page 2: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 2

Outline

• Introduction• Scaling and Round-off Noise• State Variable Description of Digital Filters• Scaling and Round-off Noise Computation• Round-off Noise Computation Using State

Variable Description• Slow-Down, Retiming, and Pipelining

Page 3: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 3

Introduction• In a fixed-point digital filter implementation, the overall input-output

behavior is non-ideal. The quantization of signals and coefficients using finiteword-lengths and propagation of roundoff noises to the output are the sourcesof noise.

• Other undesirable behavior include limit-cycle oscillations where undesirableperiodic components are present at filter output even in the absence of anyinput. These may be caused due to internal rounding or overflow.

• Scaling is often used to constrain the dynamic range of the variables to acertain word-length

• State variable description of a linear filter: provides a mathematicalformulation for studying various structures. These are most useful to computequantities that depend on the internal structure of the filter. Power at eachinternal node and the output round-off noise of a digital FIR/IIR filter can beeasily computed once the digital filter is described in state variable form

Page 4: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 4

Scaling and Round-off Noise

• Scaling: A process of readjusting certain internal gain parameters inorder to constrain internal signals to a range appropriate to the hardwarewith the constraint that the transfer function from input to output shouldnot be changed

• Illustration:– The filter in Fig.11.1(a) with unscaled node x has the transfer

function

– To scale the node x, we divide F(z) by some number β and multiplyG(z) by the same number as in Fig.11.1(b). Although the transferfunction does not change by this operation, the signal level at node xhas been changed

)()()()( zGzFzDzH += (11.1)

Scaling Operation

Page 5: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 5

Fig.11.1 (a) A filter with unscaled node x, (b) A filter with scaled node x’

IN OUT

F(z) G(z)

D(z)

(a)

IN OUT

F(z)/β βG(z)

D(z)

(b)

x

x’

Page 6: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 6

– The scaling parameter β can be chosen to meet any specific scalingrule such as

• where f(i) is the unit-sample response from input to the node xand the parameter δ can be interpreted to represent the numberof standard deviations representable in the register at node x ifinput is unit-variance white noise

– If the input is bounded by , then

• Equation (11.4) represents the true bound on the range of x andoverflow is completely avoided by scaling in (11.2), whichis the most stringent scaling policy

=−

=−

∑∑

=

=

02

2

01

,)(:

,)(:

i

i

ifscalingl

ifscalingl

δβ

β (11.2)

1)( ≤nu

∑∑ ∞

=

=≤−=

00)()()()(

iiifinuifnx (11.4)

(11.3)

1l

Page 7: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 7

– Input can be generally assumed to be white noise.For unit-variancewhite noise input, variance at node x is given by:

• -scaling is commonly used because most input signals can beassumed to be white noise

• (11.5) is a variance (not a strict bound). So, we can increase δin (11.3) to prevent possible overflow. But increasing δ willdecrease SNR (signal-to-noise ratio). Thus, there is a trade-offbetween overflow and round-off noise

[ ] ∑∞

==

022 )()(

iifnxE (11.5)

2l

Page 8: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 8

Scaling and Round-off Noise(cont’d)

Round-off Noise

• Round-off Noise: Product of two W-bit fixed-point fractions is a (2W-1)bit number. This product must eventually be quantized to W-bits byrounding or truncation, which results in round-off noise.

• Example:– Consider the 1st-order IIR filter shown in Fig. 11.2. Assume that the

input wordlength W=8 bits, and the multiplier coefficient wordlengthis also 8 bits. To maintain full precision in the output, we need toincrease the output wordlength by 8 bits per iteration. This is clearlyinfeasible. Thus, the result needs to be rounded or truncated to itsnearest 8-bit representation. This introduces a round-off noise e(n)(see Fig. 11.3).

Page 9: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 9

a

Fig.11.2 A 1ST-order IIR filter (W=8)

Fig.11.3 Model of Round-off Error

D

a8-bits15-bits

8-bitsu(n) x(n)

Du(n) x(n)

e(n): round-off error

Page 10: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 10

• Round-off Noise Mathematical Model: usually modeled as an infiniteprecision system with an external error input (see Fig.11.3)

• Rounding is a nonlinear operation, but its effect at the output can beanalyzed using linear system theory with the following assumptionsabout e(n)– 1.e(n) is uniformly distributed white noise– 2. e(n) is a wide-sense stationary random process (mean & covariance of

e(n) are independent of the time index n)– 3. e(n) is uncorrelated to all other signals such as input and other noise

signals

• Let the wordlength of the output be W-bits, then the round-off errore(n) can be given by

– The error is assumed to be uniformly distributed over the interval in (11.6),the corresponding probability distribution is shown in Fig.11.4, where ∆ isthe length of the interval and

22

)(2

2 )1()1( −−−−

≤≤−WW

ne (11.6)

)1(2 −−=∆ W

Page 11: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 11

Pe(x)

X2∆−

2∆

∆1

Fig.11.4 Error probability distribution

• The mean and variance of this error function:

– (11.8) can be rewritten as (11.9), where is the variance of the round-off error in a finite precision W-bit wordlength system

[ ])(neE )]([ 2 neE

[ ]

[ ]

=∆

=∆

==

=∆

==

∆−

∆−

∫∆

32

1231

)()(

02

1)()(

22

2

23

22

2

22

2

2

2

2

W

e

e

xdxxPxneE

xdxxxPneE (11.7)

(11.8)

32 22 We

−=σ

2eσ

(11.9)

Page 12: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 12

– The variance is proportional to , so, increase in wordlength by 1 bitdecreases the error by a factor of 4.

• Purpose of analyzing round-off noise: determine its effect at the output– If the noise variance at output is not negligible in comparison to the output

signal level, the wordlength should be increased or some low-noisestructure should be used.

– We need to compute the SNR at the output, not just the noise gain to theoutput

– In noise analysis, we use a double-length accumulator model: rounding isperformed after two (2W-1)-bit products are added. Notice: multipliers arethe sources for round-off noise

W22−

Page 13: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 13

State Variable Description of Digital Filters

• Consider the signal flow graph (SFG) of an N-th order digital filter inFig.11.5. We can represent it in the following recursive matrix form:

– where x is the state vector, u is the input, and y is the output of the filter; x,b and c are N×1 column vectors; is N×N matrix; d, u and y are scalars.

• Let be the unit-sample response from the input u(n) to the state and let be the unit-sample response from the state

to the output . It is necessary to scale the inputs to multipliers inorder to avoid internal overflow

⋅+⋅=

⋅+⋅=+

)()()(

),()()1(

nudnxcny

nubnxAnxT

(11.10)

(11.11)

A{ })(nfi)(nxi

{ })(ngi

)(nxi)(nyi

Page 14: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 14

• Signals x(n) are input to the multipliers in Fig11.5. We need to computef(n) for scaling. Conversely, to find the noise variance at the output, it isnecessary to find the unit-sample response from the location of the noisesource e(n) to y(n). Thus g(n) represents the unit-sample response of thenoise transfer function

• From the SFG of Fig.11.15, we can write:

A

1−z

)(ne

)( nu )(ny)(nx

Tcb

)1( +nx

d

Fig.11.5 Signal flow graph of IIR filter

AzIzb

zUzX

⋅−⋅

= −

1

1

)()(

(11.12)

Page 15: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 15

• Then, we can write the z-transform of f(n), F(z) as,

– We can compute f(n) by substituting u(n) by δ(n) and using the recursion(11.15) and initial condition f(0)=0:

– The unit-sample response g(n) from the state x(n) to the output y(n) can becomputed similarly with u(n)=0. The corresponding SFG is shown inFig.11.6, which represents the following transfer function G(z),

.1,)(

,)()()()(1

1221

≥⋅=⇒

⋅⋅⋅+++==−

−−−

nbAnf

zbzAzAIzUzXzFn

(11.13)

(11.14)

)()()1( nbnfAnf δ⋅+⋅=+ (11.15)

0,)(

,)( 1

≥⋅=⇒

⋅−= −

nAcng

zAIc

zG

nT

T

(11.16)

(11.17)

Page 16: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 16

• State covariance matrix K:

– Because X is an N×1 vector, K is an N×N matrix– K is a measure of error power at various states ( the diagonal element

is the energy of the error signal at state due to the input white noise)

1−⋅ zA

STATE OUTTc

Fig.11.6 Signal flow graph of g(n)

OUTTc

1

1−⋅− zAI

( ) ( ){ }nxnxEK T⋅≡ (11.18)

iiKix

STATE

Page 17: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 17

• Express K in a form that reflects the error properties of the filter:– State vector X(n) can be obtained by the convolution of u(n) and f(n), by

using (11.14) for f(n), we get:

– Therefore

– Assume u(n) is zero-mean unit-variance white noise, so we have:

( )

∑∞

=

−−⋅=∗=

⋅⋅⋅=

0

21

)1()()(

)](,),(),([

l

l

TN

lnubAnunf

nxnxnxnx (11.19)

(11.20)

[ ]∑ ∑

∑ ∑

∑∑

=

=

=

=

=

=

−−−−=

−−−−=

−−−−=

0 0

0 0

00

)()1()1(

))(1()1(

))(1()1()(

l m

Tml

l m

Tml

m

Tm

l

l

bAmnulnuEbA

bAmnulnubAE

bAmnulnubAEK

(11.21)

≠=−=

0,0)]()([1)]([ 2

kknunuEnuE (11.22)

(11.23)

Page 18: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 18

– Substituting (11.22) & (11.23) into (11.21), we obtain:

– Finally, we get the Lyapunov equation:

• If for some state , has a higher value than other states, thenneeds to be assigned more bits, which leads to extra hardware

and irregular design.– By scaling, we can ensure that all nodes have equal power, and the

same word-length can be assigned to all nodes.

[ ] T

K

TKKT

K

TTKKT

K

TKKT

l

TllT

l

Tll

l

T

l m

Tmlm

l

AbAbAAbbAbAbAAbb

bAbAbbbAbAbb

bAbAlflfbAbAK

⋅+=⋅+=

⋅+=⋅+=

⋅==⋅⋅=

∑∑

∑∑

∑∑∑∑

=

=

=

++∞

=

=

=

=

=

00

0

11

1

000 0

)()(

)()(

)()()()(δ

(11.24)

TT AKAbbK ⋅⋅+⋅=⇒ (11.25)

ix ][ 2ixE

ix

Page 19: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 19

• Orthogonal filter structure: All internal variables are uncorrelated andhave unit variance assuming a white-noise input, it satisfies thefollowing:

• The advantages of orthogonal filter structure:– The scaling rule is automatically satisfied– The round-off noise gain is low and invariant under frequency

transformations– Overflow oscillations are impossible

• Similarly, define the output covariance matrix W as follows:

• Proceeding in a similar manner as before, we can get

TT bbAAIK ⋅+⋅== (11.26)

∑∑∞

=

=

==00

)()()(n

nTTnT

n

T AcAcngngW (11.27)

TT ccAWAW ⋅+⋅⋅= (11.28)

Page 20: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 20

Scaling and Round-off Noise Computation

• The same word-length can be assigned to all the variables of the systemonly if all the states have equal power. This is achieved by scaling

• The state vector is pre-multiplied by inverse of the scaling matrix T.– If we denote the scaled states by , we can write,

– Substituting for x from (11.29) into (11.10) and solving for , we get

Scaling Operation

Sx)()()()( 1 nxTnxnxTnx SS ⋅=⇒⋅= − (11.29)

Sx

)()()1(

)()()1(

)()()1(11

nubnxAnx

nubTnxTATnx

nubnxTAnxT

SSSS

SS

SS

⋅+⋅=+⇒

⋅⋅+⋅⋅⋅=+⇒

⋅+⋅⋅=+⋅−−

(11.30)

(11.31)

(11.32)

Page 21: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 21

– where

• Similarly, the output equation (11.11) can be derived as follows

• The scaled K matrix is given by

• It is desirable to have equal power at all states, so the transformationmatrix T is chosen such that the Ks matrix of the scaled system has alldiagonal entries as 1.

( )bTbTATA SS⋅=⋅⋅= −− 11 ,

{ }ddTcc

nudnxc

nudnxTcny

STT

S

SSTS

ST

=⋅=⇒

⋅+⋅=

⋅+⋅⋅=

,

)()(

)()()(

(11.33)

( )T

S

TTTTTSSS

TKTK

TxxETTxxTExxEK

)(

)(])([][11

1111

−−

−−−−

⋅⋅=⇒

⋅=⋅=⋅=

(11.34)

Page 22: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 22

• Further assume T to be diagonal, i.e.,

– From (11.34) and (11.35) and let , we can obtain:

• Conclusion: By choosing i-th diagonal entry in T to be equal to thesquare root of the i-th diagonal element of K matrix, all the states canbe guaranteed to have equal unity power

• Example (Example 11.4.1,pp.387) Consider the unscaled 2nd-order filtershown in Fig.11.7, its state variable matrices are (see the next page):

T

NN

NN

Tttt

diagT

tttdiagT

)(]1

,1

,1

[

],,,[

1

2211

1

2211

−− =⋅⋅⋅⋅⋅⋅=⇒

⋅⋅⋅⋅⋅⋅= (11.35)

(11.36)

1)( =iiSK

iiii

ii

iiiiS

Kt

tK

K

=⇒

== ,1)( 2 (11.37)

(11.38)

Page 23: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 23

– Example (cont’d)

– The state covariance matrix K can be computed using (11.25) as

21−

)(nu )(ny1

161)(2 nx

1−z 1−z)(1 nx 161

Fig.11.7 An SFG of an unscaled 2nd-order filter

0,,10

,010

21

161

161

=

=

=

= dcbA

+

=

+

=

1

1000

010

010

112561

12161

21161

22

161

2221

1211

161

2221

1211

KKKK

KKKK

KKKK

Page 24: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 24

– Thus, we get:

– For scaling with δ=1, the transformation matrix is

– Thus the scaled filter is described as below and is shown in Fig.11.8

– Note: the state covariance matrix Ks of the scaled filter is

{ }0, 2112255256

2211 ==== KKKK

2l

=

25516

25516

00

T

0,

,0

,010

2558

2551

16255

1

161

1

=

=⋅=

=⋅=

=⋅⋅= −−

ST

S

SS

dcTc

bTbTATA

=

=

1001

00

00

00

16255

16255

255256

255256

16255

16255

SK

Page 25: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 25

1−z)(nu )(ny

1−z0.998

-0.501

-0.0626

1/16

)(2 nx )(1 nx

Fig.11.8 A SFG of a scaled 2nd-order filter

Page 26: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 26

• Computation: Let be the error due to round-off at state . Then theoutput round-off noise , due to this error, can be written as theconvolution of the error input with the state-to-output unit-sampleresponse :

– Consider the mean and the variance of . Since is white noise withzero mean, so we have:

)(nei

Round-off Noise Computation

Scaling and Round-off Noise Computation (cont’d)

ix)(nyi

)(nei)(ngi

∑∞

=

−=∗=0

)()()()()(l

iiiii lnglengneny (11.39)

)(nyi )(nei

[ ] ,0)( =nyE i (11.40)

[ ]

−−= ∑∑m

iil

iii mngmelngleEnyE )()()()()(2

[ ]∑∑ −−=l m

iiii mngmeleElng )()()()(

[ ] [ ])(iancevar)(22 neneElet iie ==σ

Page 27: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 27

– (cont’d)

– Expand W in its explicit matrix form, we can observe that all its diagonalentries are of the form :

[ ]

∑∑

∑∑=−=

−⋅−=

nie

lie

l milmeii

nglng

mnglngnyE

)()(

)()()(

2222

22

σσ

δσ

(11.41)

∑n i ng )(2

⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅

⋅⋅⋅⋅⋅⋅

=

∑∑∑

∑∑∑∑∑∑

n Nn Nn N

n Nnn

n Nnn

ngngngngng

ngngngngng

ngngngngng

)()()()()(

)()()()()(

)()()()()(

221

22212

12121

[ ]∑∑ ⋅⋅⋅⋅

⋅⋅⋅==

nN

Nn

T ngngng

ng

ngngW )(,),()(

),(

)()( 1

1

(11.42)

(11.43)

Page 28: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 28

– Using (11.41), we can write the expression for the total output round-offnoise in terms of trace of W:

– Note: (11.44) is valid for all cases. But when there is no round-offoperation at any node, then the corresponding to that node should notbe included while computing noise power

– (11.44) can be extended to compute the total round-off noise for the scaledsystem, which will simply be the trace of the scaled W matrix:

– Replacing the filter parameters with the scaled parameters in (11.27), wecan show:

– Also, for a diagonal T we can write:

noiseroundofftotal __ )()( 21

21

22 WTraceWng eN

i iieN

i n ie σσσ === ∑∑ ∑ ==

(11.44)

iiW

)(2

Se WTraceσ=total round-off noise (scaled system) (11.45)

TWTW T

S⋅⋅= (11.46)

( ) ( ) ( )∑∑==

⋅==N

iiiii

N

iiiSS

WtWWTrace1

2

1

(11.47)

Page 29: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 29

– (11.47) can be rewritten as follows because

– Conclusion: The round-off noise of the scaled system can be computedusing (11.48), i.e., using

• Example (Example 11.4.2, p.390) To find the output round-off noise for thescaled filter in Fig.11.8, W can be calculated using (11.28) as

iiii Kt ≡

( ) ( ) ⇒⋅= ∑=

N

iiiiiS

WKWTrace1

( )∑=

⋅=N

iiiiie WK

1

2σtotal round-off noise (scaled system) (11.48)

{ }iiii WK ,

2l

+−

−+=

+

=

25564

112558

12161

2558

21161

2551

222561

25564

2558

2558

2551

161

2221

1211161

2221

1211

010

010

WWWW

WWWW

WWWW

Page 30: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 30

– Thus

– The total output round-off noise for the scaled filter is

– For the unscaled filter in Fig.11.7:

– Thus

−=

2559.00332.00332.00049.0

2221

1211

WWWW

( ) 222211 2608.0 eeWW σσ =⋅+

+−−+

=

+

=

41

11321

12161

321

21161

2561

222561

41

321

321

2561

161

2221

1211161

2221

1211

010

010

WWWW

WWWW

WWWW

−=

2549.00333.00333.00049.0

2221

1211

WWWW

Page 31: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 31

– The total output round-off noise for the unscaled filter is

– Notice: The scaled filter suffers from larger round-off noise, which canalso be observed by comparing the unscaled and scaled filter structure:

• In the scaled filter, the input is scaled down by multiplying 0.998 tothe input to avoid overflow (See Fig.11.8). Therefore, to keep thetransfer functions the same in both filters, the output path of thescaled filter should have a gain which is 1/0.998 times the gain of theoutput path of the unscaled filter. Thus the round-off noise of thescaled filter is times that of the unscaled filter

• The above observation represents the tradeoff between overflow andround-off noise: More stringent scaling reduces the possibility ofoverflow but increases the effect of round-off noise

– Notice: (11.48) can be confirmed by:

( ) 222211 2598.0 eeWW σσ =⋅+

12608.02598.0

)(_)(_

<=scalednoiseroundoff

unscalednoiseroundoff

2998.01

( ) ( )scaledunscaled WWWKWK 221122221111 2608.0)2549.00049.0(255256 +==+=+

Page 32: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 32

Round-off Noise Computation UsingState Variable Description

Algorithms for Computing K and W

• Parseval’s relation and Cauchy’s residue theorem are useful for findingsignal power or round-off noise of digital filters. But, they are not usefulfor complex structures.

• The power at each internal node and the output round-off noise of acomplex digital filter can be easily computed once the digital filter isdescribed in state variable form

• Algorithm for computing K– Using (11.24), K can be computed efficiently by the following algorithm:

(see it on next page)

Page 33: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 33

• Algorithm for computing K (cont’d)– 1. Initialize:

– 2. Loop:

– 3. Computation continues until

• Algorithm analysis:– After the 1st-loop iteration:

– After the 2nd-loop iteration:

TbbKAF ⋅←← ,

2, FFFAFK T ←⋅⋅←

0=F

=

+⋅⋅=2

)(

AF

bbAbbAK TTT

(11.49)

=

+++=4

2233 ,)()(

AF

bbAbbAAbbAAbbAK TTTTTTT

(11.50)

Page 34: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 34

– Thus, each iteration doubles the number of terms in the sum of (11.24).The above algorithm converges as long as the filter is stable (because theeigen-values of the matrix A are the poles of the transfer function)

– This algorithm can be used to compute W after some changes

• Algorithm for Computing W– 1. Initialize:

– 2. Loop:

– 3. Computation continues until

• Example (Example 11.6.1, p.404) Consider the scaled-normalized latticefilter in Fig.11.9. We need to compute the signal powers at node 1, 2and 3:– Because there are 3 states (1—3), the dimensions of the matrix A, b, c and

d are 3×3, 3×1, 3×1, and 1×1, respectively. From Fig.11.9, the stateequations can be written as (see next page)

TT ccWAF ⋅←← ,

2, FFFWFW T ←⋅⋅←

0=F

Page 35: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 35

+++=+=+

−+=+++−=+

)(0029.0)(3054.0)(1035.0)(0184.0)()(9743.0)(2252.0)1(

)(2093.0)(9054.0)(3695.0)1(),(8467.0)(0443.0)(1915.0)(4944.0)1(

321

313

3212

3211

nunxnxnxnynxnxnx

nxnxnxnxnunxnxnxnx

Page 36: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 36

Fig.11.9 A 3rd-order scaled-normalized lattice filter(also see Fig.11.18, p.403, Textbook)

)(nu

0029.0 0569.0

z-1 z-1z-1

)(ny

3209.0

532.0 9293.0 9293.0−

3695.0

3695.0

9743.0− 9743.0

2252.0

2252.0

323.0 9984.0 9471.0

1# 2# 3#

8467.0

Page 37: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 37

– From these equations, matrices A, b, c and d can be obtained directly. Bysubstituting them into the K-computing algorithm, we get

– Since , so no scaling is needed for nodes1—3. In addition, the K matrix shows that the signals at nodes 1—3 areorthogonal to each other since all off-diagonal elements are zeros

– By the W-computing algorithm, we obtain:

• Conclusion:– Using state variable description method, we can compute signal

power or round-off noise of a digital filter easily and directly.However, it can not be used on the nodes that are not connected tounit-delay branches because these nodes do not appear in the statevariable description

=

100010

001

K

}1{ 332211 === KKK

}3096.0,2952.0,1455.0{ 332211 === WWW

Page 38: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 38

Slow-Down, Retiming, and Pipelining

Introduction

• Many useful realizations contains roundoff nodes that are not connectedto unit-delay branches. Thus these nodes (variables) do not appear in astate variable description and the scaling and roundoff noisecomputation methods can not be applied directly.

• The SRP ( slow-down and retiming/pipelining) transformation techniquecan be used as a preprocessing step to overcome this difficulty– Slow-down: every delay element (Z) in the original filter is changed into M

delay element (ZM)– Retiming and Pipelining (Please see Chapters 4 and 3 for details)

Page 39: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 39

• Slow-down: Consider the filter in Fig.11.10(b) which is obtained by applyingslow-down transformation (M=3) to the filter in Fig.11.10(a). By 3 slow downtransformation, every Z-variable in Fig.11.10(a) is changed into Z3. Thus thetransfer function of the transformed filter H’(Z) is related to the originaltransfer function H(Z) as (11.51):

– Thus, if the unit-sample response from the input to the internal node x inFig.11.10(a) is defined by:

– Then, the unit-sample response from the input to the internal node x’ inFig.11.10(b) is:

– We can get:

– Similarly it can be shown that:

)()()()(')(')(' 333 zHzGzFzGzFzH === (11.51)

},),2(),1(),0({)( ⋅⋅⋅= fffnf (11.52)

},,0,0),2(,0,0),1(,0,0),0({)(' ⋅⋅⋅= fffnf (11.53)

xxnn

xx KnfnfK === ∑∑ 22 )()]('['(11.54)

xxxx WW =' (11.55)

Page 40: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 40

Figure 11.10 (a) A filter with transfer function H(z)=F(Z)G(Z). (b) Transformed filter obtained by 3 slow-down transformationH’(Z)=F(Z3)G(Z3).

F(Z) G(Z)IN OUTx

(a)

F’(Z)=F(Z3) G’(Z)=G(Z3)IN OUTx’

(b)

Page 41: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 41

– The foregoing analysis shows that slow-down transformation does notchange the finite word-length behavior

• Pipelining:– Consider the filter in Fig.11.11(a), which has a non-state variable node x

on the feed-forward path. It is obvious that the non-state variable nodecannot be converted into the state variable node by slow-downtransformation.

– However, since x is on the feed-forward path, a delay can be placed on aproper cut-set location as shown in Fig.11.11(b). This pipelining operationconverts the non-state variable node x into state variable node. The outputsequence of the pipelined filter is equal to that of the original filter exceptone clock cycle delay.

– So, the pipelined filter undergoes the same possibility of overflow and thesame effect of round-off noise as in the original filter. Thus it is clear thatpipelining does not change the filter finite word-length behavior

Page 42: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 42

Fig.11.11 (a) A filter with a non-state variable node on a feed-forward path(b) Non-state variable node is converted into state variable node by pipelining

c

DD

a

b

xu(n) y(n)

(a)c

DD

a

bu(n)

y(n-1)D

(b)

Page 43: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 43

• Retiming:– In a linear array, if either all the left-directed or all the right-directed edges

between modules carry at least 1 delay on each edge, the cut-setlocalization procedure can be applied to transfer some delays or a fractionof a delay to the opposite directed edges (see Chapter 4) — This is calledretiming

• SRP transformation technique is summarized as follows:– 1. Apply slow-down transformation by a factor of M to a linear array, i.e.,

replace Z by ZM. Also, apply pipelining technique to appropriate locations.– 2. Distribute the additional delays to proper locations such that non-state

variable nodes are converted to state variable nodes– 3. Apply the scaling and noise computation method using state variable

description

• Example (Example 11.7.1, p.407) Consider the filter shown in Fig.11.12, sameas the 3rd-order scaled-normalized lattice filter in Fig.11.9 except that it hasfive more delays. The SFG in Fig.11.12 is obtained by using a 2-slowtransformation and followed by retiming or cut-set transformation. (cont’d)

Page 44: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 44

Fig.11.12 A transformed filter of the 3rd-order scaled-normalized lattice filter in Fig.11.9

(also see Fig.11.21,pp.407)

)(nu

0029.0 0569.0

z-1 z-1z-1

)(ny

3209.0

3#

8467.0

532.0 9293.0 9293.0−

3695.0

3695.0

9743.0− 9743.0

2252.0

2252.0z-1

z-1 z-1

z-1 z-1323.0 9984.0 9471.0

4#2#1#

5# 6#

7# 8#

Page 45: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 45

– (cont’d) Notice that signal power or round-off noise at every internal nodein this filter can be computed using state variable description since eachnode is connected to a unit delay branch. Since there are 8 states, thedimensions of the matrices A, b, c, and d are 8×8, 8×1, 8×1, and 1×1,respectively. From Fig.11.12, state equations can be written as follows:

+=+−=+

+=++=++=+

=+

+=+−=+

+=+

)(0029.0)(323.0)(

),(2252.0)(9743.0)1(

),(3695.0)(9293.0)1(

),(9471.0)(3209.0)1(

),(9984.0)(0569.0)1(

),()1(

),(9743.0)(2252.0)1(

),(9293.0)(3695.0)1(

),(8467.0)(532.0)1(

5

428

817

426

615

34

423

812

71

nunxny

nxnxnx

nxnxnx

nxnxnx

nxnxnx

nxnx

nxnxnx

nxnxnx

nunxnx

Page 46: Keshab K. Parhi - win.tue.nlwsinmak/Education/2IN35/Parhi/chap11.pdf · Chapter 11 3 Introduction • In a fixed-point digital filter implementation, the overall input-output behavior

Chapter 11 46

– From the above equations, matrices A, b, c, and d can be obtained directly.Using the K-computing algorithm, we obtain ,which means that every internal node is perfectly scaled. Similarly, we get

– Thus, the total output round-off noise is:– Note: no round-off operation is associated with node 4 or state .

Therefore, is not included in Trace(W) for round-off noisecomputation

• Example (omitted, study at home)– For details, please see Example 11.7.2, p.408 of textbook

}8,,2,1,1{ ⋅⋅⋅== iKii

}1912.0,0412.0,104.0,1043.0,3096.0,3096.0,2952.0,1455.0{,, 8811 =⋅⋅⋅ WW

22 191.1 ei

iiiie WK σσ == ∑4x

44W