Output gain adjuster of digital filters

Hello all,

I recently learned/heard that when implementing a IIR digital filter of direct form I, the gain has to be finely adjusted with an additionnal module on the output. Otherwise, the 0dB level will not be perfectly reached in your passband (filter is low pass) and e.g. consequently a digital value that is suppose to be 40000.0000 will be

4000.0001. Essentially, I imagine this output module to be a multiplier of 1.0000000XXXX or 0.99999XXX

I was led to believe this problem does not arise with digital filter implementations of direct form II.

Is this true ? Looking over the flow diagrams of the 2 type of filters, I do not understand why one form would require a gain adjustement and the other would not.

P.S The filter is being implemented in an FPGA, not in a DSP. P.S The passband ripple is tiny, below 1e-4dB

All help will be appreciated. Regards

-Roger

Reply to
Roger Bourne
Loading thread data ...

I haven't heard this myself. I would think that any error is simply quantization (round-off error), i.e. it wouldn't exist if implemented with infinite-precision arithmetic and isn't intrinsic to the DF I. But some filter forms do fair better than others in terms of numerical issues such as round-off, so it is possible that one implementation might be "better" than another, even though they are theoretically equivalent. (In actuality, they are only equivalent if implemented with infinite-precision arithmetic.)

Is your FPGA filter doing floating-point? I'm curious, as that seems pretty uncommon in the FPGA world.

"In theory, theory and practice are identical. But in practice, they are not!"

--
Jon Harris
SPAM blocker in place:
 Click to see the full signature
Reply to
Jon Harris

Seems to be tough demands. You are playing with deviations in the 7th-9th significant digit, which is on the order of the numerical accuracy of single precision floating-point numbers.

Assuming you use single precision floats: No, this is not true. Numerical inaccuracies on this scale occur, no matter what filter structure you use.

One difference between type i and type 2 filters, is that one is more robust with respect to numerical noise than the other. However, I find it hard to believe that a gain adjustement is used in order to correct for deviations on the scale indicated above.

It may be that the magnitudes of internal variables are different, so that the gain needs to be adjusted in order to prevent overflow in fixed-point arithmetics implementations.

Rune

Reply to
Rune Allnor

...

How many dB error is that? Do you care? How many significant bits in your calculation?

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

1 part in 40 million would be at least 26 bits. Something like measuring kTB hiss in the air during a nuclear explosion. :-)

Steve

Reply to
Steve Underwood

A meter was originally defined as 1/10,000,000th of the length of the quadrant between the North Pole and the equator passing through Paris. The currently defined meter is very close to that. Roger Bourne's error is the same as a one-meter error in the measured circumference of our planet. Pretty good mensuration, by most standards.

Jerry

--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.