Hi, I am pretty new to Z transforms, I need some help.
I have the following difference equation:
y(n) +0.25y(n-1) - .125y(n-2) = x(n-1)-0.5x(n-2)
y(0) = 0
All I need to do is get the transfer function H(z) and find the poles and zeros.
Here is my attempt:
Taking Z transform of the difference equation:
y(z) + 0.25*z^-1*Y(z) - .125*z^-2*Y(z) = z^-1*X(z) - 0.5*z^-2*X(z)
Then the transfer function is:
H(z) = (Z^-1 - 0.5Z^-2) / (0.25z^-1 - .125Z^-2)
Then I have poles at Z = 0 and Z=-0.5
Now to check myself I used matlab. The matlab answer is very different from mine. This is what bothers me. Here is the matlab code.
numz = [1 -0.5];
denz = [1 (1/4) (-1/8)];
DiscreteSystem = tf(numz,denz,-1);
DiscreteSystem
Transfer function:
z - 0.5
--------------------
z^2 + 0.25 z - 0.125
pole(DiscreteSystem)
ans =
-0.5000
0.2500
So did I do something wrong, if so where? Thank you.
I have the following difference equation:
y(n) +0.25y(n-1) - .125y(n-2) = x(n-1)-0.5x(n-2)
y(0) = 0
All I need to do is get the transfer function H(z) and find the poles and zeros.
Here is my attempt:
Taking Z transform of the difference equation:
y(z) + 0.25*z^-1*Y(z) - .125*z^-2*Y(z) = z^-1*X(z) - 0.5*z^-2*X(z)
Then the transfer function is:
H(z) = (Z^-1 - 0.5Z^-2) / (0.25z^-1 - .125Z^-2)
Then I have poles at Z = 0 and Z=-0.5
Now to check myself I used matlab. The matlab answer is very different from mine. This is what bothers me. Here is the matlab code.
numz = [1 -0.5];
denz = [1 (1/4) (-1/8)];
DiscreteSystem = tf(numz,denz,-1);
DiscreteSystem
Transfer function:
z - 0.5
--------------------
z^2 + 0.25 z - 0.125
pole(DiscreteSystem)
ans =
-0.5000
0.2500
So did I do something wrong, if so where? Thank you.