Originally Posted by

**TomMUFC** Hi all,

I am stuck on a particular question with regards to obtaining a difference equation from a given transfer function. I know how to do this in most cases, but I can't do this one:

---------------------------------------------------------------------------------------------------------

The transfer function of a certain digital filter, running at a sample rate of fs = 10kHz is given by:

$\displaystyle H(z) = (1-r) + (r^2-1)z^-2/1-2rcos(WcT)z^-1 +r^2z^-2$

Where Wc and r are constants that parameterise the filter coefficients: Wc is an angular frequency and r is a real number.

**(a) what is the difference equation of this filter?**

(b) Is the impulse response of this filter finite or infinite?

(c) What is the range of (real) values of r for which the filter is stable?

-----------------------------------------------------------------------------------------------------------

(Btw, Wc is "Omega small subscript c")

Here's my answer (which is drastically wrong btw):

H(z) = Y(z)/X(z)

Y(z)(1-2rcos(WcT)z^-1 + r^2z^-2) = X(z)(1-2rcos(WcT)z^-1 + r^2z^-2)

y(n) - (1-2rcos(WcT)y(n-1) + r^2y(n-2) = x(n) - rx(n) + r^2x(n-2)-x(n-2)

y(n) = x(n) - rx(n) + r^2x(n-2) - x(n-2) + 2rcos(WcT)y(n-1) + r^2y(n-2)

It's important I obtain the answer to this correctly otherwise I can't go on to do parts (b) and (c) properly.

Appreciate if anyone knows the answer to this.