0
$\begingroup$

I have a 1st order lowpass IIR filter of the form

$ H(z) = \frac{b_{0} +b_{1} z^{-1}}{1+a_{1} z^{-1}} $

implemented using the direct method my code looks something like this

state2=state1;
state1=signal x-state2*a1;
output=b0*state1+b1*state2;    

that has a cutoff frequency X that has been calculated from the fundamental frequency of signal x. Now given that the fundamental frequency of signal x changes and it takes me time "t" to detect this new frequency, is there any way I can reduce the transient response that I see from resetting the states to zero and changing the a and b coefficiets (by logging the states, old filter output or other data over time "t" and using this to calculate the new states rather than resetting them to 0) ? Or would someone be able to provide me with a signpost as to what topics i should be googling?

$\endgroup$
  • 1
    $\begingroup$ Just change the coefficients and do not reset the state. $\endgroup$ – Matt L. Dec 10 '14 at 14:31
  • $\begingroup$ Do you see transients when changing coefficients? $\endgroup$ – ruoho ruotsi Dec 10 '14 at 18:23
1
$\begingroup$

How about running two filters parallel with each other. Both filters get the same input signal but only one filter will output the filtered signal because there is a crossfader behind them which will pass only one of the filters output. You can change the parameters of the currently offline filter, and fade the crossfader to it. Parameter changing without any transient.

Transient free iir parameter changing

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.