Engee documentation

sos2tf

Converting the data of the second-order sections of the digital filter into a transfer function.

Library

EngeeDSP

Syntax

Function call

  • b,a = sos2tf(sos) — returns the coefficients of the transfer function of a discrete system described in the form of a second-order section sos.

  • b,a = sos2tf(sos,g) — returns the coefficients of the transfer function of a discrete system described in the form of a second-order section sos with a gain factor g.

Arguments

Input arguments

# sos — representation of the second-order section

+ the matrix

Details

The representation of the second-order section, defined as a matrix. Argument sos — this is a matrix of size

the rows of which contain the coefficients of the numerator and denominator and second-order sections of the function :

Типы данных

Float64

Support for complex numbers

Yes

# g is the total gain of the system

+ scalar

Details

The total gain of the system, given as a real scalar.

Типы данных

Float64

Output arguments

# b,a are the coefficients of the transfer function

+ vectors

Details

Coefficients of the transfer function returned as row vectors. Output arguments b and a they contain the coefficients of the numerator and denominator of the function stored in descending order of degrees :

Examples

Representation of a second-order partition system using a transfer function

Details

Let’s calculate the representation of a simple second-order partition system using a transfer function.

import EngeeDSP.Functions: sos2tf

sos = [1  1  1  1  0 -1; -2  3  1  1 10  1]
b, a = sos2tf(sos)
println("b = ", b, "\na = ", a)
b = [-2.0 1.0 2.0 4.0 1.0]
a = [1.0 10.0 0.0 -10.0 -1.0]

Algorithms

In sos2tf The function is used conv to multiply all second-order polynomials in the numerator and denominator. For higher-order filters (possibly starting from the 8th order), numerical problems may arise due to rounding errors when forming the transfer function.