DSP Blockset Previous page   Next Page
Filter Realization Wizard

Construct filter realizations using Sum, Gain, and Integer Delay blocks

Library

Filtering / Filter Designs

Description

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:

  1. Open the filter realization wizard by typing dspfwiz, or double-clicking the block in the Filter Designs library or in a model.
  2. Specify a filter (including its data type support) by either designing a filter using the Design Filter panel, or by importing a filter using the Import Filter panel. To learn how, see Specifying the Filter and Its Data Type Support.
  3. Optionally change the default filter structure and the default number of filter sections. To learn how, see Setting the Filter Structure and Number of Filter Sections.
  4. Do the following in the Realize Model panel:
  5. Click Realize model in the Realize Model panel to realize the filter. A new block appears in a specified model. Double-click the new block to see the filter realization, as illustrated in the following figure.

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.

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:

  • Direct form I
  • Direct form II
  • Direct form I transposed
  • Direct form II transposed
  • Second order sections for direct form I and II, and their transposes
  • Direct form FIR
  • Direct form FIR transposed
  • Direct form antisymmetric FIR
  • Direct form symmetric FIR

  • Lattice ARMA
  • Lattice AR
  • Lattice MA (same as lattice minimum phase)
  • Lattice all-pass
  • Lattice maximum phase
  • Cascade
  • Parallel

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:

  1. Open the Realize Model panel in FDATool by clicking the Realize Model button in the lower-left corner of FDATool.
  2. Set the Destination parameter to one of the following:
  3. In the Block Name parameter, type a name for the subsystem block.
  4. If you set the Destination parameter to Current model, the Overwrite generated `Filter' block parameter becomes enabled, which has the following behavior:

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:

  1. Open the Realize Model panel in FDATool by clicking the Realize Model button in the lower-left corner of FDATool .
  2. Select the desired optimizations in the Optimization region of the Realize Model pane. See the following descriptions and illustrations of each optimization option.

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:

  1. Open the Realize Model pane by clicking the Realize Model button in the lower-left corner of FDATool .
  2. Appropriately set the parameter in the Block Type region of the Realize Model pane (see the following table and figures). The default setting of the parameter depends on the filter, and is always the most appropriate setting for the specified filter.

 

Appropriate Use of Block Type Settings
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:
  • Fixed-point filters
  • Single-precision filters
  • Filters with different input, output, and computation data types

  • Sum, Gain, and Integer Delay blocks configured in the specified filter structure, and set to compute using the appropriate data types
  • Gateway In block for the input quantizer
  • Conversion blocks for the multiplicand quantizers, and for the output quantizer

See the following note and the figure called Implementations of Double-Precision and Fixed-Point Filters.

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:

Dialog Box

Destination
The location where the new filter block should be created: in a new model, or in the current (most recently selected) model.
Block name
The name of the new filter block.
Overwrite generated `Filter' block
When selected, the block overwrites any filter block in the current model with the name specified in the Block name parameter. Enabled when the Destination parameter is set to Current model. For more information, see Setting Where to Put the Filter.
Block Type
Determines the data type support of the filter implementation. Set to 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.
Optimize for zero gains
When selected, the block removes zero-gain paths from the filter structure. For an example, see Optimizing the Filter Structure.
Optimize for unity gains
When selected, the block substitutes gains equal to one with a wire (short circuit). For an example, see Optimizing the Filter Structure.
Optimize for -1 gains
When selected, the block substitutes gains equal to -1 with a wire (short circuit), and changes the corresponding sums to subtractions. For an example, see Optimizing the Filter Structure.
Optimize delay chains
When selected, the block substitutes any delay chains made up of n unit delays with a single delay by n. For an example, see Optimizing the Filter Structure.
Realize Model
Click to create 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 frame-based row vector signal, and outputs the result.

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


Previous page  FFT FIR Decimation Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS