I have a set of measurement which I want to model with 2nd-order difference equations (first order eqs don't model well enough).
The equation is
$$y[n] = \alpha_1 y[n-1] + \alpha_2 y[n-2] + \beta_0 x[n] + \beta_1 x[n-1]$$
I want a generic formula for the impulse response.
I did a derivation, but being a total DSP beginner, I'm not sure whether it's correct or I'm missing some bits:
The transfer function is:
$$\begin{align} H(z) &= \displaystyle \frac{Y(z)}{X(z)} \\ &= \frac{\beta_0 + \beta_1 z^{-1}}{1 - \alpha_1 z^{-1} - \alpha_2 z^{-2}} \\ &= \frac{\beta_0 z^2 + \beta_1 z}{z^2-\alpha_1 z -\alpha_2 } \\ &= \frac{A_1 \, z}{z-p_1} + \frac{A_2 \, z}{z-p_2} \\ &= A_1\frac{1}{1-p_1 z^{-1}} + A_2\frac{1}{1-p_2 z^{-1}} \\ \end{align}$$
where $p_{1,2}$ are the poles and $A_1$ and $A_2$ can be calculated using partial fraction expansion.
Therefore the impulse response is
$h[n] = \big(A_1 p_1^n + A_2 p_2^n \big) u[n], $
where $u[n]$ is the discrete step function.
Is this ok?