Engee documentation

tf2latc

Conversion of the coefficients of the transfer function of the filter into the form of a lattice filter.

Library

EngeeDSP

Syntax

Function call

  • k,v = tf2latc(b,a) — returns the lattice coefficients k and ladder coefficients v for a lattice-ladder IIR filter (AutoRegressive Moving Average, ARMA), normalized by a[1]. The function returns an error if one or more lattice coefficients are exactly equal 1.

  • k,v = tf2latc(b0,a) — returns the coefficients of a ladder in which only the first element of the vector v non-zero. The argument b0 is a scalar.

  • k,v = tf2latc(1,a) — returns the lattice coefficients k and ladder coefficients v for an all-pole lattice IIR filter (AutoRegressive, AR).

  • k,v = tf2latc(b) — returns the lattice coefficients k and ladder coefficients v for a lattice FIR filter (Moving Average, MA), normalized by b[1].

  • k,v = tf2latc(b,phase) — sets the type of lattice FIR filter (MA): minimum-phase or maximum-phase.

Arguments

Input arguments

# b,a are the coefficients of the transfer function

+ vectors

Details

The coefficients of the transfer function, given as vectors.

Типы данных

Float32, Float64

# b0 — coefficients of the numerator of the transfer function

+ scalar

Details

The coefficients of the numerator of the transfer function, given as a scalar.

Типы данных

Float32, Float64

# phase — type of FIR filter (MA)

+ "none" (by default) | "max" | "min"

Details

The type of FIR filter (MA), specified as "max" or "min". For the maximum-phase filter, specify the value "max". For the minimum-phase filter, specify the value "min".

Типы данных

String

Output arguments

# k — lattice coefficients

+ vector

Details

The lattice coefficients returned as a vector.

# v — ladder coefficients

+ vector

Details

Ladder coefficients returned as a vector.

Examples

Converting the coefficients of an all-pole IIR filter into lattice coefficients

Details

We convert the all-pole IIR filter into lattice coefficients.

import EngeeDSP.Functions: tf2latc

a = [1 13/24 5/8 1/3]
k, v = tf2latc(1, a)
println("k = ", k)
k = [0.24999999999999997; 0.5000000000000001; 0.3333333333333333;;]