Engee documentation

scaleFilterSections

Scaling cascaded transfer functions using scale values.

Library

EngeeDSP

Syntax

Function call

Arguments

Input arguments

# B — coefficients of the numerator of the cascade transfer function without scaling

+ the matrix

Details

Coefficients of the numerator of the cascade transfer function (CTF) without scaling, set as a matrix:

  • Number of rows in B equals , where — the number of cascade filter sections.

  • The number of columns in B equals , where — the order of the section.

  • If you specify B in the form of a vector, then scaleFilterSections will process B as a matrix, determining the number of sections and the order of the numerator depending on the size of the vector:

    • The vector-string — function processes B as a one-section transfer function with numerator order , where — the number of columns. Each -th column B respond the coefficient of the numerator.

    • The vector-column — function processes B how -a sectional transfer function with scalar numerators. Each line B corresponds to the numerator in each corresponding section.

Data types

Float64

Support for complex numbers

Yes

# g — scale values

+ scalar | vector

Details

Scale values specified as a real scalar or length vector , where — number of CTF sections:

  • If g scalar, then the function distributes the scale value evenly over all sections of the filter.

  • If g vector, then the function applies the first applies the scale values to the corresponding filter sections and distributes the last scale value evenly across all filter sections.

Data types

Float64

Support for complex numbers

None

Output arguments

# Bg is a matrix of scaled coefficients of the CTF + numerator the matrix

Details

Scaled coefficients of the CTF numerator, returned as a matrix of the same size as B.

For more information, see Algorithms.

Data types

Float64

Support for complex numbers

Yes

Additional Info

Cascading Transfer Functions (CTF)

Details

Dividing 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 through transfer functions it has the form:

filtfilt en

Algorithms

Details

Function scaleFilterSections scales the matrix B using a scalar or vector g and returns Bg in the form of one of the following values:

  • If g — scalar:

    L = size(B, 1)
    gL = (abs(g))^(1/L)
    Bg = B * gL
    Bg[L, :] = sign(g) * Bg[L, :]
  • If g — vector c the counts set by sections:

    L = size(B, 1)
    gS = g[end]
    gL = (abs(gS))^(1/L)
    gl = g[1:end-1]
    Bg = B .* gl[:] * gL
    Bg[L, :] = sign(gS) * Bg[L, :]

Literature

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