Engee documentation

sos2ctf

Converting these second-order sections of a digital filter into the form of a cascade transfer function.

Library

EngeeDSP

Syntax

Function call

  • B,A = sos2ctf(sos,g) — also sets the scale factors g to scale the gain factor by sections of the transfer function of the system.

Arguments

Input arguments

# sos — representation of second-order sections

+ the matrix

Details

The representation of the second-order sections, defined as a matrix of size , where — the number of second-order sections. The matrix

It represents sections of the second-order function :

Типы данных

Float32, Float64

Support for complex numbers

Yes

# g — scale factors

+ 1 | scalar | vector

Details

Scale factors specified as a scalar or vector with real values containing elements where — the number of second-order sections.

Function sos2ctf applies the gain to the filter sections using the function scaleFilterSections. Depending on the value specified in the argument g:

  • scalar — the function distributes the gain evenly across all filter sections;

  • vector — the function applies the first applies the gain values to the corresponding filter sections and distributes the last gain value evenly across all filter sections.

Output arguments

# B,A are the coefficients of the cascade transfer function

+ L × 3 matrices

Details

The coefficients of the cascade transfer function returned as matrices of size on , where — the number of second-order sections.

In matrices B and A The coefficients of the numerator and denominator of the cascade transfer function are listed, respectively. For more information, see Representation of digital filters in CTF format.

Examples

Second-order sections for the cascade transfer function

Details

We transform the matrix of sections of the second order into the form of a cascade transfer function.

import EngeeDSP.Functions: sos2ctf

sos = [2 4 2 1 0 0; 3 2 0 1 1 0]

ctfB, ctfA = sos2ctf(sos)
println("ctfB = ", ctfB, "\nctfA = ", ctfA)
ctfB = [2 4 2; 3 2 0]
ctfA = [1 0 0; 1 1 0]

Additional Info

Cascading transfer functions

Details

Splitting a digital IIR filter into cascaded sections increases its numerical stability and reduces its susceptibility to coefficient quantization errors. Cascade form of the transfer function expressed in terms of transfer functions , has the form

butter en

Representation of digital filters in CTF format

Details

Specify the arguments B and A to get the coefficients of the filter. By specifying these output arguments, you can design digital filters in CTF format for signal analysis, visualization, and filtering.

coeffects of the filter

If you specify the representation of the numerator and denominator coefficients in CTF format, -lowercase matrices and they are returned as

thus, the total transfer function of the filter is

where — the order of the filter numerator, and — the order of the denominator.

The following functions can be used to visualize and analyze filters in CTF format:

Algorithms

Function sos2ctf calculates the coefficients of the numerator and denominator of the sections of the cascade transfer function based on the coefficients of the second-order sections of the filter system.

Output arguments B and A they contain the coefficients of the cascade transfer function of the second order of the filter system, located in lines.

  • Each row of the matrices A and B contains the coefficients in each section.

  • Function sos2ctf returns matrices B and A size on where the last two columns correspond to the members and for each cascade section of the filter system.

For a matrix of second-order sections sos and a single scale factor (g = 1) values for B and A they will be as follows:

B = sos[:, 1:3];
A = sos[:, 4:6];

If you specify an argument g, function sos2ctf distributes the values of the scale coefficients from g by the coefficients of the numerator, so that the values for B and A they will be as follows:

B = scaleFilterSections(sos[:, 1:3], g);
A = sos[:, 4:6];

Literature

  1. Lyons, Richard G. Understanding Digital Signal Processing. Upper Saddle River, NJ: Prentice Hall, 2004.