DSPRelated.com
Forums

IIR filter - DC offset after swapping coefficients

Started by Unknown July 25, 2003
The crossfading idea mentioned in an earlier thread and earlier in this thread 
is the only IIR solutioon.  The problem you're having has to do with the 
internal states of the filters.  I suspect that there is a similar problem 
when switching from the longer filter to the shorter filter as well, just not 
as obvious.  

If you want a solution that will work, use FIR filters.  They will work with 
your situation and the computational complexity is similar to an IIR filter 
and less than running two IIR filters in parallel.

In article <dlm2ivcqt1g68v3evvjmocgk8o1804ed8n@4ax.com>, 
r_obert@REMOVE_THIS.hotmail.com wrote:
>Hello, > >I have an application that has a standard IIR high pass filter with a >long time constant. During certain conditions, a shorter time >constant is required, so new coefficients .. with a shorter time >contant ... are swapped in. After a designated period, the original >coefficients are returned. The problem I'm encountering is during >this last step. After the original coefficients are returned, there >is a DC offset to the signal ( that takes a long time to work it's way >through, due to the long time constant ). There must be a way to >modify the states of this IIR during the switch back to the original >coefficients, to avoid this DC offset. > >It's a single pole IIR, with the following equation: > > y(n) = b0 * x(n) + b1 * x(n-1) - a1 * y(n-1) > >I've tried a bunch of different modifications to the x(n), x(n-1) and >y(n-1) states, but while some modified the level of DC offset after >the coefficient switch, none of them eliminated it, as desired. > >Anyone have any ideas or insight on how to be rid of this DC offset >after the coefficient switch? > >Robert > >www.gldsp.com > >( modify address for return email ) > >www.numbersusa.com >www.americanpatrol.com