# Polynomial division to separate FIR and IIR in cascade

I have a FIR filter $$L(z)$$ and an IIR filter $$H(z) = \frac{B(z)}{A(z)}$$ which are cascaded together as $$L(z)H(z) = L(z)\frac{B(z)}{A(z)}$$.

For specific reasons I want to calculate a parallel topology that is equivalent to the original $$L(z)H(z)$$. I can achieve this using long division to divide $$L(z)B(z)$$ by $$A(z)$$ to obtain:

$$L(z)H(z) = \frac{L(z)B(z)}{A(z)} = Q(z) + \frac{R(z)}{A(z)}$$

Where $$Q(z)$$ is the quotient and $$R(z)$$ is the remainder of the long division of $$L(z)B(z)$$ by $$A(z)$$.

However, the resulting IIR, $$\frac{R(z)}{A(z)}$$, has a delay equal to the number of taps of the original FIR $$L(z)$$

Is it possible to do some clever re-arranging before the division so that the resulting IIR part of the long division is not delayed?

Of course one approach is to flip the filters so the magnitude of the poles are greater than one and perform long division using an unstable filter and flip back (which is a simple change of variable $$z \to \frac{1}{z}$$ and back again), but this isn't a useful solution.

• I am confused-if the given FIR filter is in parallel with the IIR filter then wouldn't the resulting transfer function be L(z) + B(z)/A(z) and not L(z)B(z)/A(z)? – Dan Boschen May 15 '20 at 23:25
• @Dan Boschen, I'm not sure you've read the question properly. The topology is stated as cascade and is converted to parallel through long division. The question is around any known tricks to manipulate the equations prior to long division (and probably manipulate again after) to end up with a parallel IIR that doesn't need a delay line. I have updated the question to make it clearer. – keith May 16 '20 at 6:17
• I understand that part now thank you. How did you conclude the resulting filter has a delay equal to the number of taps of the FIR? In general that would not be the case and regardless of any delay the two forms will match exactly only as long as the delay of the IIR filter is preserved. – Dan Boschen May 16 '20 at 11:09
• @Dan Boschen, a sketch of the proof: if the filters are causal, then the combined FIR/IIR numerator will be be in powers of $c_0 + c_1z^{-1} ... z^{-n - m}$ where $n$ is FIR length and $m$ is IIR numerator length so the remainder after division (which will be the new numerator of the IIR) will be $z^{-n} ... z^{-n-m}$. And of course, realizing and testing it... – keith May 17 '20 at 6:59
• I see now. When you referred the the delay of the resulting IIR filter, I was reading that as the filter's overall delay, not just the delay from the additional zeros added. – Dan Boschen May 17 '20 at 13:31

The way that you currently split the FIR from the IIR part results in an FIR filter that exactly matches the first $$N$$ samples of the impulse response of the original cascade. Consequently, the parallel IIR filter must have $$N$$ initial zeros in its impulse response, otherwise it would mess with that first part of the original response which is already taken care of by the FIR filter. If you choose another FIR filter, then the corresponding IIR filter won't have as many initial zeros (i.e., delays without multipliers in its implementation). The question is why you would want this, because in that case the number of additions and multiplications necessary for implementing the IIR filter would increase. You would get the same number of delays, but instead of just delaying the input you would get non-zero filter coefficients.
Note that if $$Q(z)$$ denotes the transfer function of the FIR filter, and $$R(z)$$ is the numerator of the IIR filter, you just need to satisfy the following equation:
$$R(z)=L(z)B(z)-A(z)Q(z)\tag{1}$$
There are infinitely many solutions. You can choose any arbitrary FIR filter $$Q(z)$$, and the numerator $$R(z)$$ of the corresponding IIR filter follows from $$(1)$$. The most efficient solution, however, is obtained by choosing the FIR filter that is just a truncated version of the impulse response of the original cascade. In that case, the IIR filter $$R(z)/A(z)$$ delays the input by the length of the FIR filter, and takes care of the remaining tail of the original impulse response. That solution is just the one obtained by long division.