Reputation: 858
How can I implement the bilateral z transform in MATLAB? The built-in function ztrans concerns only the unilateral z transform.
Upvotes: 2
Views: 899
Reputation:
The bilateral transform can be obtained from two unilateral transforms. Suppose f is the function to be transformed. Then ztrans
gives the sum of f(n)z-n over n=0,1,2,... Introduce the new function g(n) = f(-n-1) and apply ztrans
to it: the result is the sum of f(-n-1)z-n over n=0,1,2,... Relabeling -n-1 as new index k, we get the sum of f(k)zk+1 over negative integers k. Divide this by z and replace z by 1/z: then the result is the sum of f(k)z-k over negative integers k, which is precisely the missing part of the bilateral transform. In code it could look like
syms n z
f = sin(n);
T1 = ztrans(f, n, z);
T2 = ztrans(subs(f, n, -n-1), k, z);
B = T1 + subs(T2/z, z, 1/z);
where B is now the bilateral transform.
Upvotes: 1