You can specify digital filters in the CTF format for analysis, visualization, and signal
filtering. Specify a filter by listing its coefficients B
and
A
. You can also include the filter scaling gain across sections by
specifying a scalar or vector g
.
Filter CoefficientsWhen you specify the coefficients as L-row matrices,
it is assumed that you have specified the filter as a sequence of
L cascaded transfer functions, such that the full transfer function
of the filter is
where m ≥ 0 is the numerator order of the filter and n ≥ 0 is the denominator order.
If you specify both B and A as vectors,
it is assumed that the underlying system is a one-section IIR filter (L = 1), with B representing the numerator of the
transfer function and A representing its denominator.
If B is scalar, it is assumed that the filter is a cascade
of all-pole IIR filters with each section having an overall system gain equal to
B.
If A is scalar, it is assumed that the filter is a cascade
of FIR filters with each section having an overall system gain equal to 1/A.
Note
To convert second-order section matrices to cascaded transfer
functions, use the sos2ctf
function.
To convert a zero-pole-gain filter representation to cascaded transfer
functions, use the zp2ctf
function.
Coefficients and GainIf you have an overall scaling gain or multiple scaling gains factored out from the
coefficient values, you can specify the coefficients and gain as a cell array of the form {B,A,g}
. Scaling filter sections is especially important when you work with
fixed-point arithmetic to ensure that the output of each filter section has similar
amplitude levels, which helps avoid inaccuracies in the filter response due to limited
numeric precision.
The gain can be a scalar overall gain or a vector of section gains.
If the gain is scalar, the value applies uniformly to all the cascade filter
sections.
If the gain is a vector, it must have one more element than the number of
filter sections L in the cascade. Each of the first
L scale values applies to the corresponding filter
section, and the last value applies uniformly to all the cascade filter
sections.
If you specify the coefficient matrices and gain vector as
it is assumed that the transfer function of the filter system is