ss2zp
Converting filter parameters from the state space to a form with zeros, poles, and a gain factor.
| Library |
|
Arguments
Input arguments
# A is a matrix of states
+
the matrix
Details
The matrix of states. If the system has entrances and outputs and is described state variables, then A has the dimension on .
| Типы данных |
|
# B is the input-state matrix
+
the matrix
Details
The input-state matrix. If the system has entrances and outputs and is described state variables, then B has the dimension on .
| Типы данных |
|
# C is the output-state matrix
+
the matrix
Details
The output-state matrix. If the system has entrances and outputs and is described state variables, then C has the dimension on .
| Типы данных |
|
# D is the end—to- end transmission matrix
+
the matrix
Details
The end-to-end transmission matrix. If the system has entrances and outputs and is described state variables, then D has the dimension on .
| Типы данных |
|
# ni — entry index
+
1 (by default) | scalar
Details
The index of the input, set as an integer scalar. If the system has inputs, use the function ss2zp with the last argument ni to calculate the response to a single pulse applied to ni- I’m coming in. Specifying this argument causes the function to ss2zp use ni-f columns of matrices B and D.
| Типы данных |
|
Output arguments
# 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 discrete system
Details
Consider a discrete system defined by a transfer function
We will determine the zeros, poles, and gain directly from the transfer function. Let’s add zeros to the numerator so that its length is equal to the length of the denominator.
import EngeeDSP.Functions: tf2zp
b = [2 3 0]
a = [1 0.4 1]
z, p, k = tf2zp(b, a)
println("z = ", z, "\np = ", p, "\nk = ", k)
z = [-1.5, 0.0]
p = ComplexF64[-0.20000000000000004 - 0.9797958971132713im, -0.20000000000000004 + 0.9797958971132713im]
k = 2.0
Let’s imagine the system in the form of a state space and define the zeros, poles, and gain using the function ss2zp.
import EngeeDSP.Functions: tf2ss, ss2zp
A, B, C, D = tf2ss(b, a)
z, p, k = ss2zp(A, B, C, D, 1)
println("z = ", z, "\np = ", p, "\nk = ", k)
z = [-1.4999999999999998; -2.1535571616345988e-16;;]
p = ComplexF64[-0.20000000000000004 + 0.9797958971132713im; -0.20000000000000004 - 0.9797958971132713im;;]
k = 2.0
Algorithms
Function ss2zp finds the poles by the eigenvalues of the matrix A. Zeros represent the final solutions to the generalized eigenvalue problem.:
using LinearAlgebra
eigvals([A B; C D], diagm([ones(n); 0]))
In many situations, this algorithm produces false large but finite zeros. Function ss2zp interprets these large zeros as infinite.
Function ss2zp finds the gain factor by solving the equation for the first nonzero Markov parameters.