| DSP Blockset | ![]() |
Construct filter realizations using Sum, Gain, and Integer Delay blocks
Library
Filtering / Filter Designs
Description
| Note
Use this block to implement fixed-point or floating-point digital filters built from Sum, Gain, and Integer Delay blocks. You can either design a filter by using the block's filter design and analysis parameters, or import the coefficients of a filter you have designed elsewhere.
The following blocks also implement digital filters, but serve slightly different purposes:
|
The Filter Realization Wizard is a tool for automatically implementing a digital filter. You must specify a filter, its structure, and the data types for the filter's inputs, outputs, and computations. The filter can support double-precision, single-precision, or fixed-point data types.
The Filter Realization Wizard creates a subsystem block that implements the specified filter using Sum, Gain, and Integer Delay blocks. To see the filter implementation, double-click the subsystem block. The subsystem block applies the specified filter to any sample-based input signal, or any frame-based row vector signal, and outputs the result.
The parameters of the Filter Realization Wizard are a part of a larger GUI, the Filter Design and Analysis Tool (FDATool), from the Signal Processing Toolbox. You can use all of the powerful tools in FDATool to design and analyze your filter, and then use the Filter Realization Wizard parameters to implement the filter in your models.
To learn how to use the Filter Realization Wizard, see other sections of this reference page.
Sections of This Reference Page
Valid Inputs and Corresponding Outputs
The Filter Realization Wizard creates a new a subsystem block that implements the specified filter. The subsystem block applies the specified filter to an input signal, and outputs the result.
Valid Inputs. The subsystem block accepts inputs that are sample-based vectors and matrices, or frame-based row vectors.
Corresponding Outputs. The output of the subsystem block has the same dimensions and frame status as the input.
What Is Considered an Independent Channel. The subsystem block treats each element of a vector or matrix as an independent channel.
Steps to Implementing a Filter with This Block
The parameters for this block are in a panel of the Filter Design and Analysis Tool (FDATool) GUI. In addition to using FDATool's Filter Realization Wizard parameters in the Realize Model panel, you must also use other panels to specify your filter. (To access the different panels, use the sidebar buttons in the lower-left corner of FDATool.)
To implement a filter using the Filter Realization Wizard, you must do the following:
dspfwiz, or double-clicking the block in the Filter Designs library or in a model.
Specifying the Filter and Its Data Type Support
To specify a purely double-precision filter, you can either design a filter using the Design Filter panel, or import a filter using the Import Filter panel. (You can import dfilt filter objects as well as vectors of filter coefficients designed using functions in Signal Processing Toolbox and Filter Design Toolbox.)
You can also specify a fixed-point filter, a single-precision filter, or a filter with different input, output, and computation data types. You can specify such filters by using the Set Quantization Parameters panel, or by importing a qfilt filter object with the Import Filter panel. Both of these options require the Filter Design Toolbox.
To learn how to ensure that your filter implementation reflects the data types of the filter you specify, see Setting the Data Type of the Filter Implementation.
| Note Running a model containing implementations of non-double-precision filters requires the Fixed-Point Blockset, but you can still edit models containing such filter implementations without the Fixed-Point Blockset. For more information, see the topic on licensing information in the Fixed-Point Blockset documentation. |
See the following topics to learn how to use the panels to specify your filter:
To open a panel, click the appropriate button in the lower-left corner of FDATool.

Setting the Filter Structure and Number of Filter Sections
The Current Filter Information region of FDATool shows the structure and the number of second-order sections in your filter.

Change the filter structure and number of filter sections of your filter as follows:
The Filter Realization Wizard supports the following structures:
Note
You may not be able to directly access some of the supported structures through the Convert Structure dialog of FDATool. However, you can access all of the structures by creating a qfilt or dfilt filter object with the desired structure, and then importing the filter into FDATool. (To learn more about the Import Filter panel, see the topic on importing a filter design in the Signal Processing Toolbox documentation.)
|
Setting Where to Put the Filter
The Filter Realization Wizard creates a subsystem block that implements the specified filter. Set where the Filter Realization Wizard puts the subsystem block by doing the following:
in the lower-left corner of FDATool.
New model -- Places the subsystem block in a new model.
Current model -- Places the subsystem block in the most recently selected model.
Current model, the Overwrite generated `Filter' block parameter becomes enabled, which has the following behavior:
myFilter, and there are blocks in the model named myFilter, myFilter1, and myFilter2, your new filter subsystem is named myFilter3.
Optimizing the Filter Structure
The Filter Realization Wizard creates a subsystem block that implements the specified filter using Sum, Gain, and Integer Delay blocks. To optimize the filter implementation, (for instance, by removing unity gains), do the following:
.
Setting the Data Type of the Filter Implementation
The filter you specify can have various data types for its inputs, outputs, and computations, as described in Specifying the Filter and Its Data Type Support.
To ensure that the Filter Realization Wizard's filter implementation accurately reflects the data type(s) you specified for your filter, do the following:
.
| Block Type |
When to Use |
Blocks and Data Types Used in Implementation |
| Floating-point blocks |
Only when implementing purely double-precision filters as described in Specifying the Filter and Its Data Type Support. |
Sum, Gain, and Integer Delay blocks configured in the specified filter structure, and set to make double-precision computations. See the figure called Implementations of Double-Precision and Fixed-Point Filters. |
| Fixed-point blocks |
When implementing any of the following as described in Specifying the Filter and Its Data Type Support: |
See the following note and the figure called Implementations of Double-Precision and Fixed-Point Filters. |
| Note The filter implementation that results from the Fixed-point blocks setting described above contains blocks from the Fixed-Point Blockset, which you must install to run the filter in simulations. You can still edit the blocks used to implement the filter without installing the Fixed-Point Blockset. For more information, see the topic on licensing information in the Fixed-Point Blockset documentation. |
Implementations of Double-Precision and Fixed-Point Filters
Corresponding Method for dfilt and qfilt
The dfilt (digital filter) object in Signal Processing Toolbox and the qfilt (quantized filter) object in Filter Design Toolbox both have a method, realizemdl, that allows you to access the capabilities of the Filter Realization Wizard from the command line.
For more information about the realizemdl method, see the following topics:
dfilt reference page in the Signal Processing Toolbox documentation
realizemdl reference page in the Filter Design Toolbox documentation
Dialog Box
| Note The following parameters for the Filter Realization Wizard are in the Realize Model panel of the Filter Design and Analysis Tool (FDATool) GUI. To open different panels of FDATool, click the different buttons at the lower-left corner. For more information about relevant panels, see Specifying the Filter and Its Data Type Support. |
Current model. For more information, see Setting Where to Put the Filter.
Floating-point blocks when implementing purely double-precision filters. Otherwise, set to Fixed-point blocks. For more information, see Setting the Data Type of the Filter Implementation.
| Note For more information about relevant parameters in other panels of FDATool, see Specifying the Filter and Its Data Type Support. |
References
Oppenheim, A. V. and R. W. Schafer. Discrete-Time Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.
Proakis, J. and D. Manolakis. Digital Signal Processing. 3rd ed. Englewood Cliffs, NJ: Prentice-Hall, 1996.
Supported Data Types
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| Digital Filter |
DSP Blockset |
| Digital Filter Design |
DSP Blockset |
qfilt |
Filter Design Toolbox |
filter |
Filter Design Toolbox |
realizemdl |
Filter Design Toolbox |
dfilt |
Signal Processing Toolbox |
filter |
Signal Processing Toolbox |
| FFT | FIR Decimation | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |