Difference equation from a transfer function of a low pass filter

I need to get the difference equation from this transfer function:

$$H(z) = g \frac{1+a_1}{1+a_1z^-1}$$

My math skills are too many years old, but I remember I need to get the Y(output) on one side and X (input) on the other:

$$\frac{Y(z)}{X(z)} = g \frac{1+a_1}{1+a_1z^-1}$$

But I don't remember where to go from here.

• $y[n] = g(1+a_1)x[n]-a_1y[n-1]$ Nov 4, 2021 at 7:35
• Thank you so much! Now I'm going to try and figure out how you got there. Thanks again. Nov 4, 2021 at 15:03
• In the step where you say you're getting the input on one side and the output on the other, it may help to actually do that. I.e. $Y(z) (\mathrm {some\ stuff}) = X(z) (\mathrm {some\ other\ stuff})$ Nov 5, 2021 at 3:19

\begin{align*} \frac{Y(z)}{X(z)}&=g\frac{1+a_1}{1+a_1z^{-1}} &\text{...given transfer function}\\ Y(z)(1+a_1z^{-1})&=X(z)g(1+a_1) &\text{...via cross multiplication}\\ Y(z)+a_1z^{-1}Y(z)&=g(1+a_1)X(z) &\text{...via distribution}\\ y[n]+a_1y[n-1]&=g(1+a_1)x[n] &\text{...via inverse z-transform}\\ y[n]&=g(1+a_1)x[n]-a_1y[n-1] &\text{...solve for y[n]} \end{align*}