For a recursive filter, suppose a set of $b$ and $a$ coefficients have been calculated. Assume a state-space representation for which an initial set of $z$-values have also been calculated as in Python's lfilter_zi function.

The author of this post demonstrates code that applies the filter using the state-space model.

We know that an equivalent filter representation is the recursive one

$y[n] = \sum_{i=1}^{N} a[i]y[n-i] + \sum_{i=0}^{N} b[i]x[n-i]$

My question is as follows: what are the pre-history values of $x$ and $y$ that, when used to cold-start the filter using the recursive formula, yield the same results as the application of the state-space model?

For example, for a 2nd order filter, I want to plug in the values of $x[-2]$, $x[-1]$, $y[-2]$ and $y[-1]$ in the recursive formula above for n=0 and n=1 and obtain the same results as when using the optimal $z$-values from the state-space model.

  • $\begingroup$ you can find those intial values of $y[-1]$, $y[-2]$, by running the filter backwards... But beware that filter initial conditions can refer to intermediate states and not necessarily output values. $\endgroup$ – Fat32 May 24 at 19:47

Your Answer

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

Browse other questions tagged or ask your own question.