Signal Processing Toolbox |
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:
dfilt
--lets you specify the filter structure and creates a digital filter object.
filter
--for b
and a
coefficient input, implements a direct-form II transposed structure and filters the data. For dfilt
input, filter uses the structure specified with dfilt
and filters the data.
Note
Using filter on b and a coefficients normalizes the filter by forcing the a0 coefficient to be equal to 1. Using filter on a dfilt object does not normalize the 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:
dfilt
.
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
:
Filter Discretization | Selected Bibliography |
© 1994-2005 The MathWorks, Inc.