I have the following rather exotic transfer function:
$$ H(z) = cz^{-m} + \frac{b_0 z^{-1} + b_1z^{-2} + \dots + b_{2m}z^{-2m}}{1 + a z^{-1}} + \frac{q_0 z^{-1} + q_1z^{-2} + \dots + q_{2m}z^{-2m}}{1 + p z^{-1}} $$
Where $c$, $b_0,\ldots,b_{2m}$, $a$, $q_0,\ldots, q_{2m}$, $p$ are real valued constants and $m > 1$.
How do I go about converting this to a finite difference equation via the inverse $\mathcal Z$-transform?
I thought I had got to grips with the inverse $\mathcal Z$-transform, but I can't seem to convert $H(z)$ to a finite difference equation that produces the right output.
My attempt:
$$\begin{align} y[n] &= c x[n - m] &+& (b_0 x[n - 1] + \dots + b_{2m} x[n - 2m]) \\ &&-& a y[n - 1]\\ &&+& (q_0 x[n - 1] + \dots + q_{2m} x[n - 2m])\\ &&-& p y[n - 1] \end{align}$$
This doesn't seem to be correct. When I test this its magnitude response is not even close to the original transfer function.
My assumption is that the three terms $cz^{-m}$, $\frac{b_0 z^{-1} + b_1z^{-2} + \ldots + b_{2m}z^{-2m}}{1 + a z^{-1}}$, $\frac{q_0 z^{-1} + q_1z^{-2} + \ldots + q_{2m}z^{-2m}}{1 + p z^{-1}}$ can be transformed separately.