Main Content

ztrans

Z-transform

Description

example

ztrans(f)finds theZ-Transformoff. By default, the independent variable isnand the transformation variable isz. Iffdoes not containn,ztransusessymvar.

example

ztrans(f,transVar)uses the transformation variabletransVarinstead ofz.

example

ztrans(f,var,transVar)uses the independent variablevarand transformation variabletransVarinstead ofnandz, respectively.

Examples

collapse all

Compute the Z-transform ofsin(n). By default, the transform is in terms ofz.

syms n f = sin(n); ztrans(f)
ans = (z*sin(1))/(z^2 - 2*cos(1)*z + 1)

Compute the Z-transform ofexp(m+n). By default, the independent variable isnand the transformation variable isz.

syms m n f = exp(m+n); ztrans(f)
ans = (z*exp(m))/(z - exp(1))

Specify the transformation variable asy. If you specify only one variable, that variable is the transformation variable. The independent variable is stilln.

syms y ztrans(f,y)
ans = (y*exp(m))/(y - exp(1))

Specify both the independent and transformation variables asmandyin the second and third arguments, respectively.

ztrans(f,m,y)
ans = (y*exp(n))/(y - exp(1))

Compute the Z-transform of the Heaviside function and the binomial coefficient.

syms n z ztrans(heaviside(n-3),n,z)
ans = (1/(z - 1) + 1/2)/z^3
ztrans(nchoosek(n,2))
ans = z/(z - 1)^3

Find the Z-transform of the matrixM. Specify the independent and transformation variables for each matrix entry by using matrices of the same size. When the arguments are nonscalars,ztransacts on them element-wise.

syms a b c d w x y z M = [exp(x) 1; sin(y) i*z]; vars = [w x; y z]; transVars = [a b; c d]; ztrans(M,vars,transVars)
ans = [ (a*exp(x))/(a - 1), b/(b - 1)] [ (c*sin(1))/(c^2 - 2*cos(1)*c + 1), (d*1i)/(d - 1)^2]

Ifztransis called with both scalar and nonscalar arguments, then it expands the scalars to match the nonscalars by using scalar expansion. Nonscalar arguments must be the same size.

syms w x y z a b c d ztrans(x,vars,transVars)
ans = [ (a*x)/(a - 1), b/(b - 1)^2] [ (c*x)/(c - 1), (d*x)/(d - 1)]

Compute the Z-transform of symbolic functions. When the first argument contains symbolic functions, then the second argument must be a scalar.

syms f1(x) f2(x) a b f1(x) = exp(x); f2(x) = x; ztrans([f1 f2],x,[a b])
ans = [ a/(a - exp(1)), b/(b - 1)^2]

Ifztranscannot transform the input then it returns an unevaluated call.

syms f(n) f(n) = 1/n; F = ztrans(f,n,z)
F = ztrans(1/n, n, z)

Return the original expression by usingiztrans.

iztrans(F,z,n)
ans = 1/n

Input Arguments

collapse all

Input, specified as a symbolic expression, function, vector, or matrix.

Independent variable, specified as a symbolic variable. This variable is often called the "discrete time variable". If you do not specify the variable, thenztransusesn. Iffdoes not containn, thenztransuses the functionsymvar.

Transformation variable, specified as a symbolic variable, expression, vector, or matrix. This variable is often called the "complex frequency variable." By default,ztransusesz. Ifzis the independent variable off, thenztransusesw.

More About

collapse all

Z-Transform

The Z-transformF=F(z)of the expressionf=f(n)with respect to the variablenat the pointzis

F ( z ) = n = 0 f ( n ) z n .

Tips

  • If any argument is an array, thenztransacts element-wise on all elements of the array.

  • If the first argument contains a symbolic function, then the second argument must be a scalar.

  • To compute the inverse Z-transform, useiztrans.

版本历史

之前介绍过的R2006a