Engee documentation

zp2tf

Converting filter parameters with zeros, poles, and gain into the form of a transfer function.

Library

EngeeDSP

Syntax

Function call

  • b,a = zp2tf(z,p,k) — transforms the factorized representation of the transfer function

    systems with one input and multiple outputs (Single-Input/Multi-Output, SIMO) in a polynomial representation of the transfer function

Arguments

Input arguments

# z — zeros

+ vector | the matrix

Details

The zeros of the system are specified as a column vector or matrix. Argument z It has as many columns as there are output signals. The zeros must be real or represent complex conjugate pairs. Use values Inf as placeholders in z if some columns have fewer zeros than others.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# p — poles

+ vector

Details

The poles of the system, defined as a column vector. The poles must be real or represent complex conjugate pairs.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# k — gain factors

+ vector

Details

The system’s gain coefficients, set as a column vector.

Типы данных

Float32, Float64

Output arguments

# b — coefficients of the numerator of the transfer function

+ vector | the matrix

Details

The coefficients of the numerator of the transfer function, returned as a row vector or matrix. If b — a matrix, the number of rows in it is equal to the number of columns of the matrix z.

# a — coefficients of the denominator of the transfer function

+ vector

Details

The coefficients of the denominator of the transfer function, returned as a string vector.

Examples

Transfer function of the mass-spring system

Details

Let’s calculate the transfer function of the damped mass-spring system satisfying the differential equation

The measured value is acceleration , and — the driving force. In Laplace space, the system is represented as follows:

The system has a single gain factor, double zero at and two complex conjugate poles.

k = 1
z = [0, 0]
p = roots([1, 0.01, 1])
2×1 Matrix{ComplexF64}:
 -0.0050000000000000044 + 0.999987499921874im
  -0.004999999999999977 - 0.999987499921874im

Using the function zp2tf to find the transfer function.

import EngeeDSP.Functions: zp2tf

b, a = zp2tf(z, p, k)
([1.0 0.0 0.0], [1.0 0.009999999999999981 0.9999999999999999])

Algorithms

The system is transformed into the form of a transfer function using the function poly with p and the columns of the matrix z.