Accelerating the pace of engineering and science

# Documentation

## Importing a Filter Design

### Import Filter Panel

The Import Filter panel allows you to import a filter. You can access this region by clicking the Import Filter button in the sidebar.

The imported filter can be in any of the representations listed in the Filter Structure pull-down menu. You can import a filter as second-order sections by selecting the check box.

Specify the filter coefficients in Numerator and Denominator, either by entering them explicitly or by referring to variables in the MATLAB® workspace.

Select the frequency units from the following options in the Units menu, and for any frequency unit other than Normalized, specify the value or MATLAB workspace variable of the sampling frequency in the Fs field.

To import the filter, click the Import Filter button. The display region is automatically updated when the new filter has been imported.

You can edit the imported filter using the Pole/Zero Editor panel.

### Filter Structures

The available filter structures are:

• Direct Form, which includes direct-form I, direct-form II, direct-form I transposed, direct-form II transposed, and direct-form FIR

• Lattice, which includes lattice allpass, lattice MA min phase, lattice MA max phase, and lattice ARMA

• Discrete–time Filter (dfilt object)

The structure that you choose determines the type of coefficients that you need to specify in the text fields to the right.

#### Direct-form

For direct-form I, direct-form II, direct-form I transposed, and direct-form II transposed, specify the filter by its transfer function representation

$H\left(z\right)=\frac{b\left(1\right)+b\left(2\right){z}^{-1}+b\left(3\right){z}^{-2}+\dots b\left(m+1\right){z}^{-m}}{a\left(1\right)+a\left(2\right){z}^{-1}+a\left(3\right){Z}^{-3}+\dots a\left(n+1\right){z}^{-n}}$

• The Numerator field specifies a variable name or value for the numerator coefficient vector b, which contains m+1 coefficients in descending powers of z.

• The Denominator field specifies a variable name or value for the denominator coefficient vector a, which contains n+1 coefficients in descending powers of z. For FIR filters, the Denominator is 1.

Filters in transfer function form can be produced by all of the Signal Processing Toolbox™ filter design functions (such as fir1, fir2, firpm, butter, yulewalk). See Transfer Function for more information.

Importing as second-order sections.  For all direct-form structures, except direct-form FIR, you can import the filter in its second-order section representation:

$H\left(z\right)=G\text{ }\text{ }\prod _{k=1}^{L}\frac{{b}_{0k}+{b}_{1k}{z}^{-1}+{b}_{2k}{z}^{-2}}{{a}_{0k}+{a}_{1k}{z}^{-1}+{a}_{2k}{z}^{-2}}$

The Gain field specifies a variable name or a value for the gain G, and the SOS Matrix field specifies a variable name or a value for the L-by-6 SOS matrix

$SOS=\left(\begin{array}{cccccc}{b}_{01}& {b}_{11}& {b}_{21}& 1& {a}_{11}& {a}_{22}\\ {b}_{02}& {b}_{12}& {b}_{22}& 1& {a}_{12}& {a}_{22}\\ ·& ·& ·& ·& ·& ·\\ ·& ·& ·& ·& ·& ·\\ {b}_{0L}& {b}_{1L}& {b}_{2L}& 1& {a}_{1L}& {a}_{2L}\end{array}\right)$

whose rows contain the numerator and denominator coefficients bik and aik of the second-order sections of H(z).

Filters in second-order section form can be produced by functions such as tf2sos, zp2sos, ss2sos, and sosfilt. See Second-Order Sections (SOS) for more information.

#### Lattice

For lattice allpass, lattice minimum and maximum phase, and lattice ARMA filters, specify the filter by its lattice representation:

• For lattice allpass, the Lattice coeff field specifies the lattice (reflection) coefficients, k(1) to k(N), where N is the filter order.

• For lattice MA (minimum or maximum phase), the Lattice coeff field specifies the lattice (reflection) coefficients, k(1) to k(N), where N is the filter order.

• For lattice ARMA, the Lattice coeff field specifies the lattice (reflection) coefficients, k(1) to k(N), and the Ladder coeff field specifies the ladder coefficients, v(1) to v(N+1), where N is the filter order.

Filters in lattice form can be produced by tf2latc. See Lattice Structure for more information.

#### Discrete-time Filter (dfilt object)

For Discrete-time filter, specify the name of the dfilt object. See dfilt for more information.

#### Multirate Filter (mfilt object)

For Multirate filter, specify the name of the mfilt object. See mfilt in the DSP System Toolbox™ product for more information.