filter
Onedimensional digital filter of fi
objects
Syntax
y
= filter(b
,1,x
)
[y
,zf
]
= filter(b
,1,x
,zi
)
y
= filter(b
,1,x
,zi
,dim
)
Description
filters
the data in the fixedpoint vector y
= filter(b
,1,x
)x
using
the filter described by the fixedpoint vector b.
The function returns the filtered data in the output fi
object y
.
Inputs b
and x
must
be fi
objects. filter
always
operates along the first nonsingleton dimension. Thus, the filter
operates along the first dimension for column vectors and nontrivial
matrices, and along the second dimension for row vectors.
[
gives
access to initial and final conditions of the delays, y
,zf
]
= filter(b
,1,x
,zi
) zi
,
and zf
. zi
is
a vector of length length(
,
or an array with the leading dimension of size b
)1length(
and
with remaining dimensions matching those of b
)1x
. zi
must
be a fi
object with the same data type as y
and zf
.
If you do not specify a value for zi
, it
defaults to a fixedpoint array with a value of 0
and
the appropriate numerictype
and size.
performs
the filtering operation along the specified dimension. If you do not
want to specify the vector of initial conditions, use y
= filter(b
,1,x
,zi
,dim
)[]
for
the input argument zi
.
Input Arguments

Fixedpoint vector of the filter coefficients. 

Fixedpoint vector containing the data for the function to filter. 

Fixedpoint vector containing the initial conditions of the
delays. If the initial conditions of the delays are zero, you can
specify zero, or, if you do not know the appropriate size and If you do not specify a value for 

Dimension along which to perform the filtering operation. 
Output Arguments

Output vector containing the filtered fixedpoint data. 

Fixedpoint output vector containing the final conditions of the delays. 
Examples
More About
Tips
The
filter
function only supports FIR filters. In the general filter representation, b/a, the denominator, a, of an FIR filter is the scalar 1, which is the second input of this function.The
numerictype
ofb
can be different than thenumerictype
ofx
.If you want to specify initial conditions, but do not know what
numerictype
to use, first try filtering your data without initial conditions. You can do so by specifying[]
for the inputzi
. After performing the filtering operation, you have thenumerictype
ofy
andzf
(if requested). Because thenumerictype
ofzi
must match that ofy
andzf
, you now know thenumerictype
to use for the initial conditions.
Algorithms
Extended Capabilities
Version History
Introduced in R2010a