# Z-Transforms and Floor Functions

When I take the $Z$-Transform of the Floor function:

ZTransform[ Floor[x], x, z]


I get

z/(-1 + z)^2


But when I do:

InverseZTransform[ z/(-1 + z)^2, z, x]

x


... rather than Floor[x]...

Is this an error in Mathematica or is my understanding wrong?

Is there a way to take the discrete-time $Z$-transform on a list, say: { 1, 2, 3, 4, 5, 6, 7, 8, 9}... and then the inverse $Z$-transform?

• Hi and welcome to Mathematica.SE! You might want to have a look at the formatting help so you can format your code. Commented Apr 13, 2014 at 13:00
• From the definition of the z transform it seems to follow that x is an integer. So Floor[x] or x should be the same. Commented Apr 13, 2014 at 13:40

From definition

so f[z] is evaluated first, if known, and then the ztransform is computed. So what you get back is the value of of the function, not the function itself. In this case, Mathematica simplified Floor[x] to x, which I think due to the discrete assumption in the definition. I tested this in Maple, and Maple did the same assumption.

f = {Floor[x], Ceiling[x], Round[x]};
ZTransform[f, x, z]


All the functions f produced the same ztransform. Since all the functions evaluated to same value, which is x

InverseZTransform[%, z, x]
(* {x, x, x} *)


If the function whose ztranform you are trying to find can't be evaluated, Mathematica does not give a ztransform for

 ZTransform[foo[x], x, z]


Is there a way to take the discrete-time Z-transform on a list, say: { 1, 2, 3, 4, 5, 6, 7, 8, 9}... and then the inverse Z-transform?

list = {1, 2, 3, 4, 5, 6, 7, 8, 9};
ZTransform[list, x, z]


InverseZTransform[%, z, x]


• I tried to use the partial fraction expansion: Apart[z/(-1 + z)^2] = 1/(-1 + z)^2 + 1/(-1 + z) and InverseZTransform[1/(-1 + z)^2, z, x] + InverseZTransform[1/(-1 + z), z, x] = UnitStep[-1 + x] + (-1 + x) UnitStep[-1 + x]... The function seems to give the correct step function in the interval [0,1]: Plot[UnitStep[-1 + x] + (-1 + x) UnitStep[-1 + x], {x, 0, 10}] Commented Apr 13, 2014 at 14:47
• And Table[UnitStep[-1 + x] + (-1 + x) UnitStep[-1 + x], {x, 1, 10}] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} Commented Apr 13, 2014 at 15:10

Is there a way of taking a list and taking its ZTransform and inverse? Here's one way that applies the definition of the ZTransform directly (which is straightforward, since there are only a finite number of terms in the sum).

list = {5, 3, -2, 0, 4, -3};
h[z_] = Sum[list[[i]] z^-i, {i, 1, Length[list]}]


This can then be put through the inverse transform:

q[n_] = InverseZTransform[h[z], z, n]
DiscretePlot[q[n], {n, -17, 17}, PlotRange -> All]


which returns the same values as were in the list.

Observe that this answer is different from Nasser's. Since the ZTransform threads through lists, the function ZTransform[{1,2,3},n,z] is taking the ZTransform of the function that is 1 for all n, then the ZTransform of the function that is 2 for all n, etc.