Main Content

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

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(z)=b(1)+b(2)z1+b(3)z2+b(m+1)zma(1)+a(2)z1+a(3)Z3+a(n+1)zn

  • 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(z)=Gk=1Lb0k+b1kz1+b2kz2a0k+a1kz1+a2kz2

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=(b01b11b211a11a22b02b12b221a12a22············b0Lb1Lb2L1a1La2L)

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.