|On this page…|
The filterbuilder function provides a graphical interface to the fdesign object-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 functionality of filterbuilder is greatly expanded by the DSP System Toolbox™. Many of the features described or displayed below are only available if the DSP System Toolbox is installed. You may verify your installation by typing ver at the command prompt.
The basic workflow in using filterbuilder is to choose the constraints and specifications of the filter, and to use those 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 upon the desired performance criteria. The following are the details of each of the steps for designing a filter with filterbuilder.
When you open the filterbuilder tool by typing:
at the MATLAB® command prompt, the Response Selection dialog box appears, listing all possible filter responses available in DSP System Toolbox.
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 will mostly use the Main pane.
The Bandpass Design dialog box contains all the parameters you need 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.
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 may change based upon 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.
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, whereas if the Order Mode field is set to Specify, the design method available is IIR least p-norm.
By expanding the Design options section of the Algorithm frame, you can further customize the algorithm specified. The options available will 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.
To analyze the filter response, click on the View Filter Response button. The Filter Visualization Tool opens displaying the magnitude plot of the filter response.
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 Signal Processing Toolbox 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