Signal Processing Toolbox |
The filter Function
filter
is implemented as the transposed direct-form II structure, where n-1 is the filter order. This is a canonical form that has the minimum number of delay elements.
At sample m, filter
computes the difference equations
In its most basic form, filter
initializes the delay outputs zi(1), i = 1, ..., n-1 to 0. This is equivalent to assuming both past inputs and outputs are zero. Set the initial delay outputs using a fourth input parameter to filter
, or access the final delay outputs using a second output parameter:
Access to initial and final conditions is useful for filtering data in sections, especially if memory limitations are a consideration. Suppose you have collected data in two segments of 5000 points each:
Perhaps the first sequence, x1
, corresponds to the first 10 minutes of data and the second, x2
, to an additional 10 minutes. The whole sequence is x
= [x1;x2]
. If there is not sufficient memory to hold the combined sequence, filter the subsequences x1
and x2
one at a time. To ensure continuity of the filtered sequences, use the final conditions from x1
as initial conditions to filter x2
:
The filtic
function generates initial conditions for filter
. filtic
computes the delay vector to make the behavior of the filter reflect past inputs and outputs that you specify. To obtain the same output delay values zf
as above using filtic
, use
This can be useful when filtering short data sequences, as appropriate initial conditions help reduce transient startup effects.
Filtering with the filter Function | Other Functions for Filtering |
© 1994-2005 The MathWorks, Inc.