Engee documentation

ctf2zp

Converting cascaded transfer functions into a form with zeros, poles, and a gain factor.

Library

EngeeDSP

Syntax

Function call

  • z,p = ctf2zp(B,A) — calculates zeros z And the poles p a system presented as Cascaded Transfer Functions (CTF) with numerator coefficients B and the coefficients of the denominator A.

  • z,p = ctf2zp(B,A,g) — sets the scale values g for all sections of the filter.

  • ___,k = ctf2zp(___) — returns a scalar gain k the system. Use this syntax with any of the input or output arguments specified in the previous versions of the function call.

Arguments

Input arguments

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

+ scalars | vectors | matrices

Details

The coefficients of the cascade transfer function, specified as scalars, vectors, or matrices. In matrices B and A The coefficients of the numerator and denominator of the cascade transfer function are listed, respectively.

The matrix B must have a size of on , and the matrix A on , where

  • — number of filter sections;

  • — the order of the numerators of the filter;

  • — the order of the denominators of the filter.

For more information about the cascade transfer function format and coefficient matrices, see Setting digital filters in CTF format.

If any element of the matrix A[:,1] not equal to 1, then the function ctf2zp normalizes the filter coefficients by A[:,1]. In this case A[:,1] it must be non-zero.
Типы данных

Float64, Float32

Support for complex numbers

Yes

# g — scale values

+ 1 (by default) | scalar | vector

Details

Scale values are set as a real scalar or a vector with real values containing the element where — the number of sections of the cascade transfer function. The scale values represent the distribution of the filter gain across the sections of the cascade filter representation.

Function ctf2zp applies the gain to the filter sections using the function scaleFilterSections depending on the way the argument is set g:

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

  • 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.

Типы данных

Float64, Float32

Output arguments

# z,p — zeros and poles of the system

+ vectors

Details

The zeros and poles of the system, returned as column vectors.

Vectors z and p They contain zeros and poles of the transfer function accordingly.

# k is the system gain factor

+ scalar

Details

The system’s gain, returned as a scalar.

Scalar represents the gain factor of the transfer function .

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 in terms of transfer functions it has the form

butter en

Setting digital filters in CTF format

Details

Digital filters can be designed in CTF format to analyze, visualize, and filter signals. The filter is set by enumerating its coefficients B and A. You can also specify the scaling factor of the filter by sections by setting a scalar or vector value. g.

coeffects of the filter

When setting coefficients in the form -lowercase matrices

it is assumed that the filter is set as a sequence of cascade transfer functions, so that the complete transfer function of the filter has the form

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

  • If and defined as vectors, it is assumed that the basic system is a single-section IIR filter ( ), where represents the numerator of the transfer function, and — its denominator.

  • If — scalar, it is assumed that the filter is a cascade of IIR filters with poles, and the total gain of the system of each cascade is equal to .

  • If — scalar, it is assumed that the filter is a cascade of FIR filters, and the total gain of the system of each cascade is equal to .

  • To convert second-order section matrices into cascade transfer functions, use the function sos2ctf.

  • To convert the filter representation with zeros, poles, and gain into cascaded transfer functions, use the function zp2ctf.

coeffects and amplification

If there is a common scale gain or several scale gain factors that are outside the values of the filter coefficients, you can specify the coefficients and gain as an array of the form [B, A, g]. Scaling the filter sections is especially important when working with fixed-point arithmetic to ensure that the output signals of each filter section have similar amplitude levels, which helps to avoid inaccuracies in the frequency response of the filter due to limited computational accuracy.

The gain can be a scalar total gain or a vector of section gain coefficients.

  • If the gain is scalar, its value is applied uniformly to all sections of the cascade filter.

  • If the gain is a vector, it must contain one element more than the number of filter sections. in the cascade. Each of the first The scale value is applied to the corresponding filter section, and the last value is applied evenly to all sections of the cascade filter.

If you specify the filter coefficient matrices and the gain coefficient vector as

it is assumed that the transfer function of the filter system has the form

Literature

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