MATLAB: Z-transform of unit step function

heavisideztrans

i have this n-domain function H[n]= (0.5^n)*u[n] and i need to find z transformation of this function. i've tried this one:
>> syms n z
>> y = ((0.5)^n)*heaviside(n);
>> yz = ztrans (y,n,z)
yz =
1/(2*z - 1) + 1/2
isn't supposed to be 1/(-0.5^z-1)+1 ? is there any solution to solve this z transform?

Best Answer

I don't have the Symbolic Toolbox but I think that the provided answer is correct. If
x[n] = 0.5^n * u[n]
=> x[n] = {,0,0,0.5^0 * 0, 0.5^1 * 1, 0.5^2 * 1,}
then the z-transform is
sum(n=-Inf:+Inf)(0.5^n)*(z^-n)
= sum(n=0:+Inf)(0.5^n)*(z^-n) % ignore all n<0
= 0.5 + sum(n=1:+Inf)(0.5^n)*(z^-n)
= 0.5 + sum(n=1::+Inf)(0.5/z)^n
= 0.5 + (0.5/z)/(1-(0.5/z)) % assuming abs(0.5/z)<1
= 0.5 + 0.5/(z-0.5)
= 1/2 + (1/2)/(z-1/2)
= 1/(2*z - 1) + 1/2