Given the difference equation as 𝑦[𝑛]=5𝑥[𝑛]+5𝑦[𝑛−2] and 𝑥[𝑛]=cos(𝜋𝑛). I would like to obtain the transfer function h[n]. How is that possible manually and on Matlab?
Manually it should be very easy yet I am stuck with a trivial part. I considered H(z) = Y(z)/X(z) then I preform z-inverse. The issue is that I am stuck with Y(z) expression in my H(z) is that okay?
On Matlab I have done the following code:
syms n x(n) y(n) x(n) = cos(pi*n); y(n)=5*x(n) + 5*y(n-2); H = ztrans(y)/ztrans(x); h = iztrans(H);
Which result in a very lengthy outcome which made me doubt whether it's correct or not.
EDIT: the range given is 0:n:20
What am I doing wrong and how can I get to the answer