Re: saturation in IIR Filter
- From: Tim Wescott <tim@xxxxxxxxxxxxxxxx>
- Date: Thu, 03 Apr 2008 09:33:48 -0500
On Thu, 03 Apr 2008 05:21:20 -0500, sooraj.tp wrote:
hi
i implemented an IIR filter in vhdl with 16 bit input and
coefficients and 16 bit output.Here i used multiplier and accumulator of
length 32 bit.Now i am facing a problem of bit growth in the output.I
read that saturation and rounding is a best way to avoid bit growth.Can
you explain the procedure for saturation and rounding and where i want
to rounding-off the bits?
Thanx in advance
Saturation means monitoring the results of an add or shift, and
saturating if there is overflow. With addition, assuming that you're
using 2's complement math, if the carry bit doesn't agree with the sign
bit then you've overflowed and you need to saturate your number to
0x80000000 or 0x7fffffff depending on the value of the carry. If, when
you go from 32 to 16 bits you keep anything but the most significant 16
bits, then you have to limit the magnitude of any 32 bit number that
would result in a 16-bit number that is 'too big'.
BTW: If this is a second order filter you may find that 16-bit data paths
are too small, at least for the intermediate values. IIR filters can
require an amount of precision that astonishes the newbie.
--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com
Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
.
- Follow-Ups:
- Re: saturation in IIR Filter
- From: sooraj.tp
- Re: saturation in IIR Filter
- References:
- saturation in IIR Filter
- From: sooraj.tp
- saturation in IIR Filter
- Prev by Date: Re: Interpolation
- Next by Date: Re: Help understanding unknown digital filter
- Previous by thread: saturation in IIR Filter
- Next by thread: Re: saturation in IIR Filter
- Index(es):
Relevant Pages
|