|MATLAB Function Reference|
Filter data with an infinite impulse response (IIR) or finite impulse response (FIR) filter
filter function filters a data sequence using a digital filter which works for both real and complex inputs. The filter is a direct form II transposed implementation of the standard difference equation (see "Algorithm").
y = filter(b,a,X)
filters the data in vector
X with the filter described by numerator coefficient vector
b and denominator coefficient vector
a(1) is not equal to
filter normalizes the filter coefficients by
filter returns an error.
X is a matrix,
filter operates on the columns of
X is a multidimensional array,
filter operates on the first nonsingleton dimension.
[y,zf] = filter(b,a,X)
returns the final conditions,
zf, of the filter delays. If
X is a row or column vector, output
zf is a column vector of
X is a matrix,
zf is an array of such vectors, one for each column of
X, and similarly for multidimensional arrays.
[y,zf] = filter(b,a,X,zi)
accepts initial conditions,
zi, and returns the final conditions,
zf, of the filter delays. Input
zi is a vector of length
max(length(a),length(b))-1, or an array with the leading dimension of size
max(length(a),length(b))-1 and with remaining dimensions matching those of
y = filter(b,a,X,zi,dim) and [...] = filter(b,a,X,,dim)
operate across the dimension
You can use
filter to find a running average without using a
for loop. This example finds the running average of a 16-element vector, using a window size of 5.
filter function is implemented as a direct form II transposed structure,
n-1 is the filter order, and which handles both FIR and IIR filters .
The operation of
filter at sample is given by the time domain difference equations
The input-output description of this filtering operation in the -transform domain is a rational transfer function,
filtic in the Signal Processing Toolbox
 Oppenheim, A. V. and R.W. Schafer. Discrete-Time Signal Processing, Englewood Cliffs, NJ: Prentice-Hall, 1989, pp. 311-312.
© 1994-2005 The MathWorks, Inc.