tf2zp
Conversion of the transfer function filter parameters into the form of zeros, poles, and gain.
| Library |
|
Syntax
Function call
-
z,p,k = tf2zp(b,a)— finds a matrix of zerosz, the vector of polespand the corresponding gain vectorkfrom the parameters of the transfer functionbanda. The function transforms the polynomial representation of the transfer functiona continuous system with one input and several outputs (Single-Input/Multi-Output, SIMO) into a multiplier form of the transfer function
Function tf2zpit should be used when working with degrees for example, in continuous transfer functions. A similar functiontf2zpkit is more useful when working with transfer functions expressed in degrees. .
Arguments
Input arguments
# b — coefficients of the numerator of the transfer function
+
vector | the matrix
Details
The coefficients of the numerator of the transfer function, specified as a vector or matrix. If b — the matrix, then each row b corresponds to the output signal of the system. Argument b contains coefficients in descending order of degrees . Number of columns b must be less than or equal to the length of the argument. a.
| Типы данных |
|
# a — coefficients of the denominator of the transfer function
+
vector
Details
The coefficients of the denominator of the transfer function, specified as a vector. Argument a contains coefficients in descending order of degrees .
| Типы данных |
|
Output arguments
# z — zeros
+
the matrix
Details
The zeros of the system returned as a matrix. Argument z contains numerator zeros in its columns. Argument z it has as many columns as there are outputs.
# p — poles
+
vector
Details
The poles of the system, returned as a column vector. Argument p contains the coordinates of the poles of the coefficients of the denominator of the transfer function.
# k — gain factors
+
vector
Details
The system’s gain coefficients, returned as a column vector. Argument k contains the gain coefficients for each transfer function of the numerator.
Examples
Zeros, poles, and the gain of a continuous system
Details
Let’s create a system with the following transfer function
Let’s find the zeros, poles, and gain of the system. Using the function eqtflength to make sure that the numerator and denominator have the same length.
import EngeeDSP.Functions: eqtflength, tf2zp
b = [2 3]
a = [1 1/sqrt(2) 1/4]
b, a = eqtflength(b, a)
z, p, k = tf2zp(b, a)
println("z = ", z, "\np = ", p, "\nk = ", k)
z = [-1.5, 0.0]
p = ComplexF64[-0.35355339059327373 - 0.35355339059327384im, -0.35355339059327373 + 0.35355339059327384im]
k = 2.0
Let’s plot the poles and zeros to make sure they are in the expected locations. Let’s add a unit circle to the graph for clarity.
import Pkg
Pkg.add("ControlSystems")
using ControlSystems
H = tf(b, a)
z, p = tzeros(H), poles(H)
pzmap(H)
annotate!([(real(zi)+0.1, imag(zi), text("Zero", 8)) for zi in z])
annotate!([(real(pi)+0.1, imag(pi), text("Pole", 8)) for pi in p])
θ = range(0, 2π, length=200)
plot!(cos.(θ), sin.(θ),
ls=:dash, color=:black,
label="Unit Circle", aspect_ratio=:equal)
display(plot!())
