Quantzaton Effects n Dgtal Flters
Dstrbuton of Truncaton Errors In two's complement representaton an exact number would have nfntely many bts (n general). When we lmt the number of bts to some fnte value we have truncated all the lower-order bts. Suppose the number s 3/64. In two's complement bnary ths s 0.000000... If we now lmt the number of dgts to 5 we get 0.00 whch represents exactly 0/64 or 5/6. The truncaton error s 5/6-3/ 64 = 3/ 64. If the exact number s 5/ 64, ths s.000000... n two's complement. Truncatng to 5 bts yelds.00 whch exactly represents / 4. The error s / 4 ( ) 5/ 64 = / 64. Ths llustrates that n two's complement truncaton the error s always negatve.
Dstrbuton of Truncaton Errors In analyss of truncaton errors we mae the followng assumptons.. The dstrbuton of the errors s unform over a range equvalent to the value of one LSB.. The error s a whte nose process. That means that one error s not correlated wth the next error or any other error. 3. The truncaton error and the sgnal whose values are beng truncated are not correlated.
Quantzaton of Flter Coeffcents Let a dgtal flter's deal transfer functon be H = 0 ( z) = + = bz If the a's and b's are quantzed, the poles and zeros move, creatng a new transfer functon Ĥ = 0 ( z) = + = az bz ˆ az ˆ where aˆ = a + a and bˆ = b + b.
Quantzaton of Flter Coeffcents The denomnator can be factored nto the form and, wth quantzaton, where pˆ = p + p ( ) ( z = + a ) z = pz D = = ( ) ( z = + a ) z = pz Dˆ ˆ ˆ to the errors n the coeffcents by = =. The errors n the pole locatons are related p p p p p = a + a + + a = a a a a = a
Quantzaton of Flter ( z) Coeffcents The partal dervatves can be found from or D a z= p ( ) D( ) D z z p = a z a = a z= p z= p ( z) ( ) p D / a = a D z / z ( z) z= p z= p + az = z = p z= p D ( = pz ) q z z z= p q= z= p = z= p
Quantzaton of Flter Coeffcents The dervatve of the qth factor s z and the overall dervatve s = ( pz ) q D( z) p p = = z z p z= p = q= = q= q z= p q ( ) ( pz ) q pp q ( z) p ( ) = ( ) ( ) p p p q = + p p p q D z p p z= p = q= = q= q q p z q
Quantzaton of Flter Coeffcents ( ) In the summaton p p p, for any other than, q = q= q ( ) the terated product p p has a factor p p = 0. Therefore q= q q the only term n the summaton that survves s the = term and ( z) D = p p p = p p ( ) ( ) + q q z p z p q p = = q= q q
Quantzaton of Flter Coeffcents Then and p a p = = p ( p ) pq q= q = ( p ) pq q= q p ap
Quantzaton of Flter Coeffcents The error n a pole locaton caused by errors n the coeffcents s strongly ( p ) pq affected by the denomnator factor whch s a product of q= q dfferences between pole locatons. So f the poles are closely spaced, the dstances are small and the error n the pole locaton s large. Therefore systems wth wdely-spaced poles are less senstve to errors n the coeffcents.
Quantzaton of Pole Locatons Consder a nd order system wth transfer functon H ( z) = + az + az and quantze a and a wth 5 bts. If we quantze a n the range a < and a < we get a fnte set of possble pole locatons.
Quantzaton of Pole Locatons If we loo at only pole locatons for stable systems, Obvously the pole locatons are non-unformly dstrbuted.
Quantzaton of Pole Locatons Consder ths alternatve nd order system desgn. H()= z dz ( ( c + jd)z ) ( c jd)z ( ) Pole locatons are unformly dstrbuted.
Quantzaton of Pole Locatons
Quantzaton of Pole Locatons
Quantzaton of Pole Locatons
Scalng to Prevent Overflow [ n] [ ] [ ] Let y be the response at node to an nput sgnal x n and let h n be the mpulse response at node. [ n] = [ m] [ n m] [ m] [ n m] y h x h x m= m= [ n] [ n] Let the upper bound on x be A. y A x m= x [ m] [ n] ( ) If we want y to le n the range -, then x n= h h [ n] guarantees that oveflow wll not occur. A <
Scalng to Prevent Overflow The condton A x n= h [ n] may be too severe n some cases. Another type of scalng that may be more approprate n some cases s A x < = [ ] ( jω n F ) e where h H. 0 Ω π max H ( jω e )
Scalng to Prevent Overflow
Scalng to Prevent Overflow
Scalng Example Assume that the nput sgnal x s whte nose bounded between - and + and that all addtons and multplcatons are done usng 8-bt two s complement arthmetc. Also let all numbers (sgnals and coeffcents) be n the range - to. H ( z) z + 0.5z z z+ 0.5 0. 0.5 0. 0.5 = = + z z z + z
Quantze the K's to 8 bts. 0 K K Scalng Example [ Q] [ Q] = 0.353 0.344 (0.000) = 0.5 0.56 (.000) Scale and quantze the v's. v v v = = [ Q] =../ [ Q] = = [ Q].338.338/.338 0.99 (0.).338 = 0.8 0.88 (.0000) 0.5 0.5/.338 0.3737 0.367 (0.00)
Scalng Example Scalng the v s scales the output sgnal but the nput sgnal may stll need scalng to prevent overflow. The exact transfer functon s H ( z) = vmβm( z) where Α z ( ) m= 0 ( z) z z ( z) ( ) 0( ) ( ) ( ) Α = + 0. 0.5. The actual Α, after quantzng the K's s Α z = + 0.978z 0.56 z. Β z =, Β z = 0.344 + z and Β z = 0.56 + 0.978z + z Therefore the actual transfer functon s 0.7407 0.7555z + 0.367z H ( z) =. + 0.978z 0.56z.
Scalng Example ( jω e ) The maxmum magntude of H n ths example s.88 and ( jω e ) the maxmum magntude of H s.5455. So the scalng factor should be /.88 = 0.347. The smplest scalng s by shftng rght. In ths case that would requre a shft of two bts to the rght to scale by 0.5. Ths s sgnfcanly less that 0.347 so a more complcated scalng mght be preferred. We could nstead scale by 0.5 + 0.065 + 0.035 = 0.34375 by shftng two bts, then four bts and then 5 bts and addng the results.
Statstcal Analyss of Quantzaton Effects The exact estmaton of quantzaton effects requres numercal smulaton and s not amenable to exact analytcal methods. But an approach that has proven useful s to treat the quantzaton nose effects as a random process problem. In dong ths we get an approxmate analytcal estmate nstead of an exact numercal smulaton. We do ths by treatng quantzaton nose as an added nose sgnal n the system everywhere quantzaton occurs.
Statstcal Analyss of Quantzaton Effects
Statstcal Analyss of Quantzaton Effects The probablty densty functon for quantzaton nose usng two's complement representaton s, LSB < q < 0 f Q ( q). LSB 0, otherwse = ( ) The expected value of the quantzaton nose s E Q = LSB/. The varance of the quantzaton nose s σ the mean-squared quantzaton nose s ( Q ) σ Q ( Q) ( ) Q LSB /. Therefore E = + E = LSB /+ LSB/ = LSB /3 =
Statstcal Analyss of Quantzaton Effects The power spectral densty functon for quantzaton nose usng two's complement representaton s G ( F ). It has an mpulse of strength LSB / 4 at 0 and s otherwse flat wth a value n F = the range / < F < /. It repeats perodcally outsde ths range. / / ( ) ( ) ( E G LSB /4) Q = Q F df = δ ( F ) + K df = Solvng, K = / / = + = LSB / 4 K LSB / 3 LSB / and ( ) ( F = + ) δ ( F ) G LSB / LSB / 4 Q Q = K
Statstcal Analyss of Quantzaton Effects ( F) ( ) δ ( F ) GQ = LSB / + LSB / 4 s the power spectral = densty of both quantzaton nose sources. The power spectral densty of the quantzaton nose effect on the output sgnal s ( F) = ( F) + ( F) G G G y y,x y, f ( F) = ( F) = ( F) where G G H G H y,x x x y Q x y y, f ( F) = y f y ( F) = Q f y ( F) π Y( F) e ( F) f y( F π ) ( ) and G G H G H x ( F) ( ) j F jπf Y e and H xy = = and H = = Q F e a Q F e a j F jπf f
Statstcal Analyss of Quantzaton Effects The two quantzaton nose sources have the same power spectral densty and they are ndependent so the output quantzaton nose s just twce what would be produced by one of them actng alone. / jπ F e P = G ( F) df a Q,y Q jπ F e / / jπ F LSB LSB = + 6 jπ F a e a / LSB LSB Evaluatng the ntegral, PQ,y = +. a 6 a e df
Statstcal Analyss of Quantzaton Effects In LSB LSB P Q,y = + LSB LSB a 6 a s the effect of the expected value of the nput a quantzaton nose and s the effect of the varance of the nput quantzaton nose. 6 a Both are dependent on a. The closer a s to one, the larger the output quantzaton nose.