Main Content

Filter Builder Design Process

Introduction to Filter Builder

The filterBuilder function provides a graphical interface to the fdesign object-oriented filter design paradigm and is intended to reduce development time during the filter design process. filterBuilder uses a specification-centered approach to find the best algorithm for the desired response.

Note

filterBuilder requires the Signal Processing Toolbox™. The DSP System Toolbox™ product greatly expands the functionality of filterBuilder. Many of the features described or displayed on this page are only available if the DSP System Toolbox is installed. You may verify your installation by typing ver at the command prompt.

Design a Filter Using Filter Builder

The basic workflow in using filterBuilder is to choose the constraints and specifications of the filter, and to use those constraints as a starting point in the design. Postponing the choice of algorithm for the filter allows the best design method to be determined automatically, based on the desired performance criteria. The following are the details of each of the steps for designing a filter with filterBuilder.

Select a Response

When you open the filterBuilder tool by typing:

filterBuilder
at the MATLAB® command prompt, the Response Selection dialog box appears, listing all possible filter responses available in DSP System Toolbox.

Response Selection window, listing the following filter responses: Lowpass, Highpass, Bandpass, Bandstop, Differentiator, Hilbert Transformer, Arbitrary Response, Pulse Shaping. The option Bandpass is selected.

Note

This step cannot be skipped because it is not automatically completed for you by the software. You must select a response to initiate the filter design process.

After you choose a response, say bandpass, you start the design of the Specifications Object, and the Bandpass Design dialog box appears. This dialog box contains a Main pane, a Data Types pane, and a Code Generation pane. The specifications of your filter are generally set in the Main pane of the dialog box.

The Data Types pane provides settings for precision and data types, and the Code Generation pane contains options for various implementations of the completed filter design.

For the initial design of your filter, you mostly use the Main pane.

Bandpass Design window. The window has two panes: Main, and Code Generation. The figure shows the Main pane.

The Bandpass Design dialog box contains all the parameters necessary to determine the specifications of a bandpass filter. The parameters listed in the Main pane depend upon the type of filter you are designing. However, no matter what type of filter you have chosen in the Response Selection dialog box, the filter design dialog box contains the Main, Data Types, and Code Generation panes.

Select a Specification

To choose the specification for the bandpass filter, you can begin by selecting an Impulse Response, Order Mode, and Filter Type in the Filter Specifications frame of the Main Pane. You can further specify the response of your filter by setting frequency and magnitude specifications in the appropriate frames on the Main Pane.

Note

Frequency, Magnitude, and Algorithm specifications are interdependent and might change based on your Filter Specifications selections. When choosing specifications for your filter, select your Filter Specifications first and work your way down the dialog box. This approach ensures that the best settings for dependent specifications display as available in the dialog box.

Select an Algorithm

The algorithms available for your filter depend upon the filter response and design parameters you have selected in the previous steps. For example, in the case of a bandpass filter, if the impulse response selected is IIR and the Order Mode field is set to Minimum, the design methods available are Butterworth, Chebyshev type I or II, or Elliptic. If the Order Mode field is set to Specify, the design method available is IIR least p-norm.

Bandpass Design window. The window has two panes: Main, and Code Generation. The figure shows the Main pane. The Algorithm section is located in the bottom third of the window. The figure shows the Butterworth design method selected.

Customize the Algorithm

By expanding the Design options section of the Algorithm frame, you can further customize the algorithm specified. The options available depend upon the algorithm and settings that have already been selected in the dialog box. In the case of a bandpass IIR filter using the Butterworth method, design options such as Match Exactly are available, as shown in the following figure.

Bandpass Design window. The window has two panes: Main, and Code Generation. The figure shows the Main pane. The Match Exactly label is located at the bottom of the Algorithm section. The figure shows the Stopband design option selected.

Analyze the Design

To analyze the filter response, click the View Filter Response button.

Realize or Apply the Filter to Input Data

When you have achieved the desired filter response through design iterations and analysis using the Filter Visualization Tool, apply the filter to the input data. Again, this step is never automatically performed for you by the software. To filter your data, you must explicitly execute this step. In the Bandpass Design dialog box, click OK and the Signal Processing Toolbox software creates the filter coefficients and exports it to the MATLAB workspace.

The filter is then ready to be used to filter actual input data. The basic filter command takes input data x, filters it through the Filter Object, and produces output y:

y = filter(Hbs,x)
To understand how the filtering command works, type:
help dfilt/filter

Tip

If you have Simulink®, you have the option of exporting this filter to a Simulink block using the realizemdl command. To get help on this command, type:

help realizemdl