| | << | < | > | >> | Notes on Finite Precision Effects in Digital Filters 16 Mar, 1999 18:09:28 |
is the Z-Transform Transfer Function,
is the unit sample response
Is the sinusoidal steady state magnitude frequency response
Is the sinusoidal steady state phase frequency response
is the Normalized frequency in radians
if
then
If the input is a sinusoidal signal of frequency
, then
the output is a sinusoidal signal of frequency
(LINEAR
SYSTEM)
If the input sinusoidal frequency has an amplitude of one and a phase of zero,
then the output is a sinusoidal (of the same frequency) with a magnitude
and phase
So, by selecting
and
,
can be determinded in terms of the filter
order and coefficients:
(Filter Synthesis)
If the linear, constant coefficient difference equation is implemented
directly:
set b1 = 1.2667653275854 set b2 = -.81668907072884 set b3 = .21187635598514Magnitude Frequency Response:
However, to implement this discrete time filter, finite precision arithmetic (even if it is floating point) is used.
This implementation is a DIGITAL FILTER
There are two main effects which occur when finite precision arithmetic is used to implement a DIGITAL FILTER:
For example, a multiplier coefficient:
might be implemented as:
The multiplier coefficient value has been quantized to a
six bit (finite precision) value.
The value of the filter coefficient which is actually implemented is 52/64 or 0.8125
AS A RESULT, THE TRANSFER FUNCTION CHANGES!
The magnitude freguency response of the third order direct
form filter (with the gain or scaling coefficient removed) is:
For n-bit two's complement fixed point numbers:
If two numbers are added (or multiplied by and integer value) then the result can be larger than the most positive number or smaller than the most negative number. When this happens, an overflow has occurred. If two's complement arithmetic is used, then the effect of overflow is to CHANGE the sign of the result and a severe, large amplitude nonlinearity is introduced.
For useful filters, OVERFLOW cannot be allowed. To prevent overflow, the digital hardware must be capable of representing the largest number which can occur. It may be necessary to make the filter internal wordlength larger than the input/output signal wordlength or reduce the input signal amplitude in order to accomodate signals inside the DIGITAL FILTER.
Due to the limited resolution of the digital signals used to
implement the DIGITAL FILTER, it is not possible to represent
the result of all DIVISION operations exactly and thus the
signals in the filter must be quantized.
The nonlinear effects due to signal quantization can result in limit cycles - the filter output may oscillate when the input is zero or a constant. In addition, the filter may exhibit deadbands - where it does not respond to small changes in the input signal amplitude.
The effects of this signal quantization can be modelled by:
where the error due to quantization (truncation of a two's complement
number) is:
By superposition, the can determine the effect on the filter output due to each quantization source.
To determine the internal wordlength required to prevent overflow and the error at the output of the DIGITAL FILTER due to quantization,
Convolution Summation (similar to Bounded-Input Bounded-Output stability
requirements):
If
then
is known as the
norm of
the unit sample response. It is a necessary and sufficient condition that
this value be bounded (less than infinity) for the linear system
to be Bounded-Input Bounded-Output Stable.
The
norm is one measure of the GAIN.
Computing the
norm for the third order direct
form filter:
input node 3, output node 8 L1 norm between (3, 8) ( 17 points ) : 1.267824 L1 norm between (3, 4) ( 15 points ) : 3.687712 L1 norm between (3, 5) ( 15 points ) : 3.685358 L1 norm between (3, 6) ( 15 points ) : 3.682329 L1 norm between (3, 7) ( 13 points ) : 3.663403 MAXIMUM = 3.687712 L1 norm between (4, 8) ( 13 points ) : 1.265776 L1 norm between (4, 8) ( 13 points ) : 1.265776 L1 norm between (4, 8) ( 13 points ) : 1.265776 L1 norm between (8, 8) ( 2 points ) : 1.000000 SUM = 4.797328
An alternate filter structure can be used to implement the same
ideal transfer function.
Third Order LDI Magnitude Response:
Third Order LDI Magnitude Response (Passband Detail):
Note that the effects of the same coefficient quantization as for
the Direct Form filter (six bits) does not have the same effect on
the transfer function. This is because of the reduced sensitivity
of this structure to the coefficients. (A general property of integrator
based ladder structures or wave digital filters which have a maximum
power transfer characteristic.)
# LDI3 Multipliers: # s1 = 0.394040030717361 # s2 = 0.659572897901019 # s3 = 0.650345952330870
The
norm values for the LDI filter are:
input node 1, output node 9 L1 norm between (1, 9) ( 13 points ) : 1.258256 L1 norm between (1, 3) ( 14 points ) : 2.323518 L1 norm between (1, 7) ( 14 points ) : 0.766841 L1 norm between (1, 6) ( 14 points ) : 0.994289 MAXIMUM = 2.323518 L1 norm between (10021, 9) ( 16 points ) : 3.286393 L1 norm between (10031, 9) ( 17 points ) : 3.822733 L1 norm between (10011, 9) ( 17 points ) : 3.233201 SUM = 10.342327
Note that even though the ideal transfer functions are the same, the effects of finite precision arithmetic are different!
To implement the direct form filter, three additions and four
multiplications are required. Note that the placement of the gain
or scaling coefficient will have a signifigant effect on the
wordlenght or the error at the output due to quantization.
Of course, a finite-duration impulse response (FIR) filter could be used. It will still have an error at the output due to signal quantization, but this error is bounded by the number of multiplications.
A FIR filter cannot be unstable for bounded inputs and coefficients and piecewise linear phase is possible by using symmetric or anti-symmetric coefficients.
But, as a rough rule an FIR filter order of 100 would be required
to build a filter with the same selectivity as a fifth order recursive
(Infinite Duration Impulse Response - IIR) filter.
|
| << | <
| > | >>
|
Copyright © 1999 L.E. Turner |