Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mark Allie comp.dsp 20041 Signal to Noise and Numeric Range issues for Direct Form I & II IIR Filters on Modern Analog Devices and TI Digital Signal Processors.

Similar presentations


Presentation on theme: "Mark Allie comp.dsp 20041 Signal to Noise and Numeric Range issues for Direct Form I & II IIR Filters on Modern Analog Devices and TI Digital Signal Processors."— Presentation transcript:

1 Mark Allie comp.dsp 20041 Signal to Noise and Numeric Range issues for Direct Form I & II IIR Filters on Modern Analog Devices and TI Digital Signal Processors Presented at the 2004 comp.dsp conference Mark Allie Consulting LLC.

2 Mark Allie comp.dsp 20042 Main Topics Filter configurations Direct Form I and II and the transposes are investigated. This presentation contains a summary of the issues of signal to noise and numeric range of Direct Form IIR filtering. Design criteria combined with sensible dsp choices are presented.

3 Mark Allie comp.dsp 20043 Direct Form I, II and Transposes Filter Assumptions. Unity gain 2nd order filter sections (biquads) are used. The transfer function of the biquad is given in equations 1 & 2. The recursive coefficients are scaled to yield a 0 = 1. The filters are implemented with all terms being added. 1212

4 Mark Allie comp.dsp 20044 Filter Forms

5 Mark Allie comp.dsp 20045 Matlab Design Example Because all products are summed the Matlab generated recursive coefficients a 1 and a 2 must be negated for use in the filter. For example a Butterworth 2nd order low pass filter with a cutoff frequency of 0.01 * Fs has the coefficients: b 0 = 0.00094469184384 b 1 = 0.00188938368768 b 2 = 0.00094469184384 a 0 = 1.00000000000000 a 1 = -1.91119706742607 use -a1 or 1.91119706742607 a 2 = 0.91497583480143 use -a2 or -0.91497583480143

6 Mark Allie comp.dsp 20046 Topics of Interest Overflow in ideal and real filters. Noise issues. Noise Compensation issues.

7 Mark Allie comp.dsp 20047 Two Types of Overflow The final result overflows. Intermediate results overflow. Overflow of the result. Unity gain filters can have outputs that are greater than ±1 with a bounded input.

8 Mark Allie comp.dsp 20048 Ideal Frequency Response

9 Mark Allie comp.dsp 20049 Ideal Time Response

10 Mark Allie comp.dsp 200410 Internal Overflow with Fixed Point Math Modulo math is your friend. Modulo math is the default when not in saturation mode. Jackson’s Rule: Any number of additions and/or subtractions may occur. Intermediate results and operands may fall into any modulo. As long as the final result is made to fall into the first modulo by design, it will be representable in two’s complement at the chosen wordlength, and a valid result. Once overflow detection is applied to the result the correct sign will be reflected in the saturated value.

11 Mark Allie comp.dsp 200411 Noise Issues Noise is generated by truncating high resolution results. The noise generated by truncation often resembles the spectrum of the signal being filtered. The generated noise is most harmful when it re- circulates through the recursive coefficients. Force correlated truncation noise to be random (white) by using dither. If the truncation process is deterministic then correction can be applied to the filter. Fixed point truncation is deterministic. Floating point truncation is not deterministic.

12 Mark Allie comp.dsp 200412 Fixed Point Truncation

13 Mark Allie comp.dsp 200413 Floating Point Truncation The data word in a floating point processor is composed of an exponent and a mantissa. The number of bits used to represent a mantissa is not directly reduced. The number of bits used to represent one mantissa is usually indirectly reduced when two numbers are added. This occurs because the exponents of floating point numbers must be equal to add them. There is no indirect truncation when the exponents are already equal. The number of bits lost is dependant on the ratio of the 2 numbers being added.

14 Mark Allie comp.dsp 200414 Floating Point Truncation For example: When adding 1 to 1/256, 7 bits are truncated because of shifting when the exponents are matched. The truncation associated with floating point addition is not deterministic in the case of Direct Form IIR filters. The number of bits truncated can be different for each addition. The number of bits truncated depends on the coefficients and input signal statistics. Truncation errors can not be corrected. They usually must be accepted! If the recursive products can be kept larger than the direct products then the recursive data path will not be truncated very much.

15 Mark Allie comp.dsp 200415 Noise compensation Fixed point compensation is accomplished through an error feedback signal. What is the error signal?e(n) = y(n) – y t (n). Floating point compensation can not be performed. So how bad is this problem?

16 Mark Allie comp.dsp 200416 How is the error term generated?

17 Mark Allie comp.dsp 200417 Direct Form Implementation Analysis Overload considerations. 1.Input scaling. 2.Modulo math. Noise generation considerations. 1.Truncation noise. 2.Terms affected.

18 Mark Allie comp.dsp 200418

19 Mark Allie comp.dsp 200419 Floating Point Truncation Analysis

20 Mark Allie comp.dsp 200420 Floating Point Truncation Analysis Example

21 Mark Allie comp.dsp 200421 Floating Point Truncation Analysis Example

22 Mark Allie comp.dsp 200422

23 Mark Allie comp.dsp 200423

24 Mark Allie comp.dsp 200424

25 Mark Allie comp.dsp 200425 Tabulated Results Fixed Point DFI DFII DFIT DFIIT Floating Point DFI DFII DFIT DFIIT Input scaling ++++++ Modulo math ++ Truncation noise +++---- Performs well with 32 bit mantissa ++++++ Error compensation +++---- + Good Attribute + Qualified Good Attribute - Poor Attribute

26 Mark Allie comp.dsp 200426 Error Compensation Fixed Point Only. Direct Forms with 1 error term. Attempt to correct noise by feeding back the error signal. Evaluate DFI based on Dottorro and Wilson.

27 Mark Allie comp.dsp 200427 Error Compensation

28 Mark Allie comp.dsp 200428 Trivial Noise Shaping with the Error Term

29 Mark Allie comp.dsp 200429 Optimal Noise Shaping with the Error Term

30 Mark Allie comp.dsp 200430 2N Word Equivalent to 2 nd Order Error Compensated Filter.

31 Mark Allie comp.dsp 200431 Is This Good News? Yes DFI and DFIIT both work. A processor with 32 bit integer native word size capabilities doesn’t need truncation error compensation. Some modern floating point processors can do this inexpensively and fast. Some modern fixed point processors can do this inexpensively and more slowly.

32 Mark Allie comp.dsp 200432 Floating Point? All DF IIR filters can work. Complicated analysis and addend evaluation. Floating point processors with extended precision results may work well. Analog devices has processors with 32 bit mantissa capabilities. Fixed point processing at 32 bits a sure bet.

33 Mark Allie comp.dsp 200433 References J. Dattorro, “The Implementation of Recursive Digital Filters for High Fidelity Audio,” J. Audio Eng. Soc., vol 36, pp 851-878 (1988 Nov) R. Wilson, “Filter Topologies,” J. Audio Eng. Soc., vol 41, pp 667-678 (1993 Sept) S.P. Lipshitz, R.A. Wannamaker and J. Vanderkooy, “Quantization and Dither: A Theoretical Study,” J. Audio Eng. Soc., vol 40, pp355-375 (1992 May)


Download ppt "Mark Allie comp.dsp 20041 Signal to Noise and Numeric Range issues for Direct Form I & II IIR Filters on Modern Analog Devices and TI Digital Signal Processors."

Similar presentations


Ads by Google