# Mathematica: how to make Z transformation of data from CSV File

I have a discrete Signal in my CSV File and I want to transform it in Z. I import the data with

 Data=Import["T:/data.csv","CSV"]


and I try to transform it

ZTranform[Data[n],n,z]


but I get this Error:

\$RecursionLimit::reclim : Recursion depth of 256 exceeded >>


What is the meaning of this?

I think you are confused on ZTransform. This expects to take an expression as a function of n, for example n^2 2^(-n). If you have just numbers, then you can't do this. You need to apply the formula itself. Assuming one-sided ZTransform, then simply write

Clear[z, n]
data = RandomReal[{0, 1}, 10];
Sum[data[[n + 1]] z^(-n), {n, 0, Length[data] - 1}]


This is simply the definition. http://mathworld.wolfram.com/Z-Transform.html

Replace data above with your own data in the CVS file. Again, I used a one-sided ZTransform in this example, which is the most common one.

• Hey Nasser M. Abbasi, Dec 21, 2012 at 13:03
• i have a list with 20225 Values. what im really doing is to multiply a ZTransformed RC model with the Z Transformation of the Current on CSV file. G(z) is my RC model und C(z) is my Current also V(z)=G(z)*C(z) . so i want to Inverse the Z Transformation of V(z) to get it on the time domain also V(t)=InverseZTransform(V(z)) but mathematica is running and i dont become any results or error.still running :-( thank you Nasser Dec 21, 2012 at 14:24

For data, Mathematica has ListZTransform, which was introduced in V9 in 2012.

SeedRandom[0];
data = RandomReal[1, 5];
data . z^-Range[0, Length[data] - 1] (* = definition *)
ListZTransform[data, z]
(*
0.652468 + 0.935202/z^4 + 0.566352/z^3 + 0.682813/z^2 + 0.63307/z
0.652468 + 0.935202/z^4 + 0.566352/z^3 + 0.682813/z^2 + 0.63307/z
*)


[Note that the Dot formula is about twice as fast as ListZTransform, both growing linearly in time, at up to 5000 data points. I'm not sure why.]