This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ELECTRONOTES . Wﬂﬂ.ﬂn§2§ l PHEASANT LANE . Feb/Mar/Apr 1987
ITHA‘CA, NY_  14850 ' FINITE_ 0RD LENGTH EFFECTS m QIGITAL was (607)27358030 an OVERALL 1.5g: The first step in digital filter design is what we can call "network design."
At this step, we use a suitable designprocedure toarrive at a transfer function
H(z). At the same time, this H(z) automatically makes available a number of
possible digital filter networks which correspond to.it. At this point, all the
'possible structures are equivalent, and there are no further complications that
are apparent, assuming all network elements and conditions are ideal.. In a_second step, we need to look at the implicatidns of various practical
limitations « principally the finite word length of the signals and network
coefficients involved. The findings and adjustments in this second step have a
major effect on the third step, which would bring in actual hardware. Among the effects to be considered in this second step of the designare the
following: "' " ' 1.. Finite m Length o_f Coefficients: When we calculate a network coefficient, we usually have its value
to arbitrary precision. When it comes down to realizing the filter
with a finite number of bits, we can't get these exactly, but must
settle for the closest digital level. Thus we get a slightly
different.filter from the one we would get with infinite precision.,
This is similar to the "passive sensitivity” problem with analog
"filters, except in the analog case, the variations from the  _
calculated design_are statistical (the tolerances of resistors and
capacitors). In the digital filter case, we.get a different filter
than nominal, but we know exactly what filter this is, since.the .'
coefficients are set exactly to the (now imperfect) digital levels
available. .These'effectshave a major influence on the choice"
among possible digital filter structures, In particular, cascade.
networks and lattice networks are preferred to direct form networks. 2. 'Roundoff and Quantization Errors of Signals: ' In the same way that we can notset the coefficients to the exact
value needed, we cannotset the signals to exact values, butmust
. 'settle for available digital levels. This process of choosing an
_ available_digital level is called quantization. Quantization can
occur in the original conversion of a signal from analog to digital
form, and also as a result of aroundoff error that occurs following
multiplication. In many cases, we can describe the effects of this
quantization error in terms of an equivalent noise, but this does
not always work well, or at all. In addition, the filter may have_
a subStantial "amplification" effect on the roundoff noise, and
this is usually a problem with recursive (feedback) structures. 3. Limit Cycle: It is clear that coefficient roundoff error can result in filters"
with.vastly.different frequency'response than desired, and often in
filters that are actually unstable; We can look at the roundoff ‘ of signals_as being equivalent to a temporary change of coefficienti'
In general this effect is temporary and random, and is best treated
in terms of noise, and not of.stability, since there is no conspired 'AN~295'(l) effort to keep the effective value of the coefficient both wrong and
"constant. The equivalent effect is more of a "noisy COETflClent", However, the rounding is clearly more important for very small signals, and
in the case of a very simple signal, or of zero signal, the effect of _ rounding can become coherent and no longer quasirandom, In the case of ' zero signal, arrived at when an input which was nonzero becomes zero, a
residual "limit cycle" oscillation can occur, This is usually a fairly
small oscillation which can be understood as the effect of rounding
placing one or more poles on the unit circle, .4. gyerflow aﬂd Overflgw Oscillations: Since there are only a limited number of hits, it is clear that it is
possible for a signal to exceed the maximumvalue, at least in some casas,
This is clearly undesirable, since at best it is a nonmlinearity. At
worse, it may cause a self—sustaining, highlevel overflow oscillation.
Thus, with a known number of bits, a good deal of scaling at various places
in the network is desirable and often necessary. ' 5. Sampling Errors; In addition to the quantization effects of sampling, we may need to watch
out for other_problems, This includes of course such problems as1
aliasing, but also errors in the A/D and D/A converters, the effective
rollmoff of the sample—andhold of the D/A, and phase distortion in the
input guard and output smoothing filters. FINITE Mono LENGTH g5 COEFFICIENTS: In the realization of‘a digital filter, there will be a certain number of bits
available at the input to a multiplier to represent the coefficient, and usually
we_need to work Only with integers. In addition, we often need to use one of these
bits to somehow represent the sign, Coefficients that happen to come out integers
needno Special consideration. However, coefficients thatare irrational fractions
need to be approximated by_suitable rational fractions, Generally the denominator of
.the rational fraction has to be a power of two, since_division is done with a right
shift, The allocation of available bits to the numerator is then.a question of the
range of coefficients that must be considered in any one multiply/accumulate operation,
More will be said about how this “largest coefficient” is determined in a moment, We can start by assuming that we have available in the system N+l total bits,
and that one bit is used for.the sign, leaving N bits, or2_N levels for representing
the magnitude ' Next we determine the largest coefficient to be realized, and we
determine the largest powerof two that is needed to represent this magnitude, and
this we denote by 2m. For example, if the magngtude of the largest coefficient is
23.l2353..., then_this lies between.24=l6 and 2 =32, so m=5.' This permits us to
determine the power oftwo,'2k, by which we must divide following multiplication.
This will be accomplished by a right shift by k bits. ' ‘The power of two by which we must divide, 2k, forces us to consider representing
a maximum magnitude of 2m, exceeding the maximum coefficient.magnitude, Thus we can
write: " ' ‘ ‘ a ' °ri N — k = m _ ' _ ,. 1. i ' (2)
_from which we determine. the unknown Value of~k from theknown_Nand'm. Next we can __,
considerthe integer.multiplier which correSponds to any given coefficient, To_do
' this we multiply the coefficient up by 2k, and then round to the nearest integer..
' Nowa‘theractualCOEfflClent that we end up With is this integer divided by 2k. This is.not the ideal value of the coefficient, but the best we can do with a specified
number of bits. However, we do knowexactly what this coefficient is now, While we ~ AN295 (2) do not end up with our nominal filter, we do end up with a filter_that we know
exactly" The determination of the exact coefficients we end up With is given by: , _ Round[02k] _  INT[c2k + 0.5] 3
C ' “"—k—'“— ‘ k ( l
2 2 where c' is the actual coefficient and c is the nominal one" The notation "Round"
indicates rounding to the nearest integer, This rounding can be done by hand, or i
ifdesired, using the “highest integer” or INT function available on many i
calculators and computers» Once all the coefficients are redetermined, according to equation (3), we can examine the resulting filter for stability and then for a suitable approximation to the desired frequency response» Having thus formalized the methods that are used to determine the coefficients
in terms of integers, we need to address the question of exactly what coefficients
are involved in any case where we need to determine the largest one. This answer
depends not just on the.structure, but in the exact manner in which the
calculations are to be done, In some cases, we must look ahead to the actual
hardware that will be involved in order to determine this, The example below will
illustrate variou5'possibilities" ' _ For our example, consider the digital filter deSign'of an 8thorder Butterworth a
low—pass which has a cutoff frequency at l/5 the sampling frequency Using bilinear
z transform method, we arrive at the transfer function: 8' 7. 6' 5' 4 .3. .'2 '
_ b 2 + b 2 + b 2 + b 2 + b 2 + b.z + b 2. + b 2 + b
“(2) = 8 7 6 5t 4 3 2 l _o (4)
8 '7 ' 6 5 4 3 2 az+ Z‘l" z+az+a +, +3
8 a7 as 42 332 + ‘ z + a
5 zalo 2 where the coefficients are given in Table l as: Table l
L an _____bn
8 l  ' l
7 lt590573 8
6 2,083835. _ l 28
5 «l0532653 _ 56 n
4 _ 00869465 70
3 »0.3l9l885 56
2 0,08209454 . .28 _
.l‘ +000l224753_ _' 8
" 0" 0100086l4464 1 Fig. l shows the corresponding realization Of this filter in direct form, here.
assuming that the coefficients can be realiZed to the full accuracy shown“ We can next consider the realization of the direct form with a limited number
of bits“ If we choose 8 bits total, this leaves 7 bits fer the magnitude. We will
concern.ourselves with the feedback coefficients, and the maximum magnitude ofthese
is the one of 2.083835, which is between 21=2 and 22=4, so here m=2. This means
that N=7 and m=2, giving k=5 (equation 2). Thus we will realize the coefficients
as fractions that have_an integer less than l28 in the numerator, and 25:32 in the
.denominator" The integers are determined by rounding the product of the nominal _
coefficient and 32. Fig“ 2 shows the result of thisapproach, which cerresponds' 
to.Fig. 15 Note that two of the coefficients have been reunded down to zero, so _
there is a loss_of'two poles.. Also,_a divider of l/256 has been added to'the" ”
"output;totkeep'thesignal.level from the feedforward_pathsrdownto reasonable 'vﬁ~“ AN—295 (3) *20083835 10532653 II
N. “0.869465 0i3l91885 0.08209454 0.01224753 r 0300086l4464 Fig. l Nominal Direct Form of a 8th0rder Butterworth Lowpass designed
using BilinearZ method with f5 =_5f3db. _ In order to judge the effect of being limited to eight bits, we can compute back
the coefficients from the integers, and this gives for the feedback coefficients the
results of Table 2. Table 2_ .11. .30. 8 1‘ 2 —51/32 =l 59375"
_ a 67/32 = 2 09375 5 49/32 =i“53125 4 28/32 =0.87500 3‘ «10/32 =~0.31250 2 3/32 = 0.09375.
' li~  .' ‘ r 0/32 = 0 0 r a . _ . .. . 0/32 = 0 These values we Can compare with those of Table l, and we see that there are somea<
important differences. To understand exactly what the consequences of these changes
ane,we can look at the change of the poles positions from nominal, and we can look at
the change of the frequency response from nominal" Fig. 3 shows the nominal pole AN¥2§S“(4) 1/256 0 ' A 'Po1es with
”i "8 bits for I . 3=,nomina15
. coeff1c1ents I ' "' “'7 AN295 (5) mmmulmummumumun IIIIII IIIIIIIuImmmmImummunmm IIIllllllll IIIllllllllllIilllllillllllllllllllil IIIIIII llﬂllII1IllIIIIIIIIIIIIIIIIIIIIHIIIIIII
II IllIIIIIIIIIIIIIIIIllllllllllllllllil llllllltllmmlillllllllllllllllulllllll F 5
IIIIllIlllIllllll!IE!{Ingliﬂilliﬂluglll IIIIIIIIIIIHIIIIIJI llllllllllﬂllllllllll , ————IIIIIIuluulmunm
nmualllummmuumﬂm lm—IW “mmI'll! MGMill 2
"IIIIIIIIII‘HIIIIII‘IIIIIII" Illllllﬂ Illmllllﬂlﬂllﬂﬂ
Ill" Hmmmn ltﬂﬂl‘lllllﬂ IHIIIIIIIIlllllllllllmIIIIIHIHIIIllllllllllllﬂlllllillI'IIIIIIIII lllllllllll‘lllﬂﬂlul mm ummmw  warm“.nnaunmnnn: inn": 9% wanna: MOHW‘O" p. mwnnuunlmﬂmm
IIImlilm:llumlullmIH—I:m
"'"""“"""' """"“"'"""'""""'"" ﬂu'.""""—'m"'"'" ""’""""' 2 mmammmmmmsmmmmmm. mﬁ'ﬁ‘émmnmnmmm ml.IIIIIIIlIlﬂllllﬂmlllllIllllmumMull'I—“Immlﬂmﬂﬂlﬂlllﬂﬂﬂllﬂﬂﬂlﬂmu
mIllllllllmIIIImiﬂﬂmlllIlllﬂlllllllllllﬂllﬂlII “null"HI"IIII‘II‘IIIWHIIIIIIIIIIIIMIMIIMI EmuIIIIIIIIIIlllllllliWﬂﬂllllﬂllllllﬂlllﬂlMllIII IIIIIIIIIIII!
IIIIIIIIIIIIIIII‘IIIlllllllllllllllﬂﬂlllllllllﬂmtllluﬂﬂllIIIIIIIIIIII uumm [Illllllllllllllllllltﬂmli
IIIIIIIIIIIIIIIIIIIWilﬂﬂiﬂlllllﬂlﬂlﬂlﬂuﬂlﬂmI“ IIIIIII IlllllllﬂlllllllﬂlIIIIIIIIIIIIIIIIMHEII It
nunlnunnnuummmmuumu man mnmumumum
IllIIIIIII Illmnummumumn IIIIIII muummmnu l‘l
lull“IIIIIIIIMIIIIIMIHIIIHIHHIII Imuummmmmmm In] mammalian
[I'lllllllllllllllﬂlllllululumlmlll Illllllllmlllinll IIIIIIII Illmmm%mmunmlmmmummu IIIIIIIIIIIIIIIIIIIIIHIIIHIIHIIIIH llllllllﬂllllllllllliﬂlllll'll IIII positions for the idea} fiiter, Whiie Fig. 4 shews the positions of the remaining'"
six poles after reaiization with 8 bits“ Cieariy there has been a substantia1
motion_in the pole positions,.aithough no poles have yet moved outside the unit circle. .\ 7 a ‘Fig; 5 shoWsthe corresponding nominal frequency response as compared to the.
'frequency response of the 8bit version” _It may be rather surprising that the.
 response is.as Tittie aitered as itis seen to be, judging from the.poie motion of
Figs 4%; _Yet there is over1 db of ripp1e_in the passband, and the filter is quite
.different from the idea1;BUtterw0rth. Note however that the 1055 of two poles does
not have much effect on the asymptotic roiioff (none seen actuaiiy). This is in
contrast to what wouidhappen with an analog fiiter. This can be attributed to the * AN295 (6) fact that the finite zeros at z=wl are still in place, and have the major influence
on the response in the rolloff region, .we can note that what actually happens in Fig. 2 is that first, all data on
the delay line shifts downward, leaving the top value open to be updated. Next,
the "data vector" on the delay line is multiplied by the "coefficient vector“ of
the feedback coefficients (a socalled "dot product" or "inner product”). This
would be done using a multiplier/accumulator, or as a single "subroutine call". _
The result of this feedback calculation (lower left summer in Fig, 2) is then scaled
by l/32 (right shifted by 5 places), and this is added to the input, and this sum
becomes the data value at the top of the delay line; Finally the feedforward path
coefficients are used in a second "dot product” call, The result is conveniently
scaled by 1/256, Note that there is no error in approximating the feedforward
coefficients since in this case of bilinearmz design, all the feedforward
coefficients are integers. Also, note that since the feedforward is a separate
multiply/accumulate operation, we need not consider the feedforward coefficients
when we find the maximum coefficient in the feedback paths. Indeed, due to the
large size of these, it would be impractical to do this, since the maximum value of
70 would dictate m=7 and thus k=0, with all feedback coefficients becoming O, l, or 2
in magnitude. Of course, we could scale the feedfbrward coefficients to any smaller
values, keeping all proportional, and this would take care of the problem. However,
it is still necessary to have separate dot product calls for the feedback and for
the feedforward, since we need to calculate the new data sample that goes into the ' a _topof the delay line, Two approaches Can be used to improving the response of the 8thorder filter,
First, we could Simply increase the number of bits that are used to represent the
_coefficients, Secondly, we could look for a better structure for our filter, It
is known, for example, that cascade form is far superior to direct fbrm in
 performance with regard to_coefficient sensitivity. This superiority in the
.specific case of a finite word_length can be attributed to two faCtors, First, there
is an inherently better sensitivity due to the decoupling of the stages in cascade
form, and to the lower order of sections, Secondly, the magnitudes of the
coefficients in cascade form are themselves generally significantly smaller and
in a'more restricted range; ' ' '_Fig, 6 shows the pole positions for the 8th—order filter realized with 12
bits instead ofonly_8. . The feedback coefficients for this case are givenin
Table 3:  Eble 3
L ' an"
8 . . 1 ' .  ._ .
7, ~814/512=—i..5898438 r 6  10877512 = 240839844 :
5' 3785/512 =.1..5332031 , r
.4 445/512, r=  0.. 8891408.“
, 3 '163/512 =0..3i83594.g_
2 42/512 = 0..08203l3
i 6/5l_2 =0..Oll7l88
._0 ' 0/512; 0 _. It isclearthat we have lost one pole here, instead of two as in the 8bit case.
.The freQUency response function here is.quite near nominal, dispite the motion of
the poles. The reSponse is within the plotting accuracy of the nominal curve in .1
_Fig,'5, : Thus we would think that l2 bits wouldbe sufficient for this particular. "g
case, If we were to moVeytoward:a'Chebyshev design, Weleuld find that this would'n .s
eventually become unsatisfactoryr. '2   . 7,, .____ ._  _ ,: . h, “1 4fA¢muCh better solution;.alternative to increasing the number of bits, isfto,12 change to a cascadestructure} :The cascade structure that correSponds to the Fig, l ANZQS (7). goh686994 _ l O.3085818 ' l O.ll6839 _ l ~00034779 1
Fig. 7 ' Nominal Cascade Form of 8th0rder Butterworth LowPass_' direct form is shown inFig» 7. Since these coefficients are smaller than in direct
form, we can expect to divideby largervalues of 2k and correspondingly be more  preCise in establishing the coefficients closer tonominal values" For thefirst
section, m=01and'thus.ke7 for.tm28 bitS'used'here" Note however that in the other_
three sections the coeffiCients are not only less than l, but also less than l/2i
This allows us to take mel, and k=8, even with 8 bits. The resdlting division by 7 256 can still be accomplished by a right shift, even though 256 is outside the range
of the 7 bits we have available'for magnitude. Fig. 8 shows the implementation of 
the cascade from in terms of integerarithmetic" ' There are usually_several ways of doing things in cascade form. Note that we
would expect that all shifts downward would occur first, and that updating would occur
in the ﬁirst stage (in a manner similar to the direct form) and propagate through the
2 filter, In this case, it is.p055ible to do the feedforward pathsof one stage along  with thefeedback paths of the succeedingstage, allas one dot product call” This
would however cause us to reducethe.value.of.2k (tol28 in this case) and some 7. degree of accuracy on the feedbaqk coefficients would beTost, ‘ _ a
'Fig, 9 shows.the pole plot of the cascade form'of Fig{ 8, and it is Very close ( r5toynominal}; As one wOuld expect, the frequency responseis near nominal as well, \h "'Qwith’in the‘plottihgjaccuracy of'Fig. Clearly the‘cascade form‘is' superior, ‘ L'?even to_the 12bit direct form. AN295 (3) i....‘,,.,....._...._.,..,......m u .. 3=~; gain (freqUency dependent of course)“ 5143 8th— ' . SCALING WITHIN'Iﬁ§_FILTER: . 
_' In'a feedback path, the division by 2k must be precisely chosen so asto
reaiize the propergain around the'loop. There is no choice inthis matter.
On the otherhand, at certain Feedforward points, we do.have some choice as to
‘ I 7‘ " ' ' For example, the input scaling
.2,and the output.sca1ing'of‘1/256 there,might.be subject to some
' * ' ' ' ' 8; as another egampie; "What "' /A for.examp1e, We would preferk .oh'something iike
_ . anaiog signal at the input should be adjusted so that the
..avai1ab1e bit size of~ . _ I r . If theSenreqUirements are not met,
jf”we"are at'ieast starting out with additionai'quantization_noise   _ _ ' tomaintain at all times a signal
.Ievei of at'ieast the Site of the D/A conVerter to come; At the same time, we $128 at anypoint, or ' t _ 7 , _ _ whiCh can be,greaterithanone; ‘uThus, f0?
'9ﬁ;exampie;'if we have a 16bit‘mu1tip1ier, we Want to maintain 16 bits of Signal. AN295 (9) If at the same time, we have a l2~bit D/A at th...
View
Full Document
 Spring '06
 HUTCHINS
 Digital Signal Processing, Signal Processing, Digital filter

Click to edit the document details