Signal Processing Toolbox Previous page   Next Page

Filter Implementation

After the filter design process has generated the filter coefficient vectors, b and a, two functions are available in the Signal Processing Toolbox for implementing your filter:

Choosing the best filter structure depends on the task the filter will perform. Some structures are more suited to or may be more computationally efficient for particular tasks. For example, often it is not possible to build recursive (IIR) filters to run at very high speeds and instead, you would use a nonrecursive (FIR) filter. FIR filters are always stable and have well-behaved roundoff noise characteristics. Direct-form IIR filters are usually realized in second-order-sections because they are sensitive to roundoff noise.

Using dfilt

Implementing your digital filter using dfilt lets you specify the filter structure and creates a single filter object from the filter coefficient vectors. dfilt objects have many predefined methods which can provide information about the filter that is not easily obtained directly from the filter coefficients alone. For a complete list of these methods and for more information, see dfilt.

After you have created a dfilt object, you can use filter to apply your implemented filter to data. The complete process of designing, implementing, and applying a filter using a dfilt object is described below:

  1. Generate the filter coefficients using any IIR or FIR filter design function.
  2. Create the filter object from the filter coefficients and the specified filter structure using dfilt.
  3. Apply the dfilt filter object to the data, x using filter.

For example, to design, implement as a direct-form II transposed structure, and apply a Butterworth filter to the data in x:

Another way to implement a direct-form II structure is with filter:


Previous page  Filter Discretization Selected Bibliography Next page

© 1994-2005 The MathWorks, Inc.