| Signal Processing Toolbox | Search  Help Desk |
| filter2 | See Also |
Two-dimensional digital filtering.
Syntax
Y = filter2(B,X)
Y = filter2(B,X,'shape')
Description
Y = filter2(B,X)
filters the two-dimensional data in X with the two-dimensional FIR filter in the matrix B. The result, Y, is computed using two-dimensional convolution and is the same size as X.
Y = filter2(B,X,'shape')
returns Y computed with size specified by shape:
same returns the central part of the convolution that is the same size as X (default).
full returns the full two-dimensional convolution, size(Y) > size(X).
valid returns only those parts of the convolution that are computed without the zero-padded edges, size(Y) < size(X).
filter2 function is part of the standard MATLAB language.
Algorithm
Thefilter2 function uses conv2 to compute the full two-dimensional convolution of the FIR filter with the input matrix. By default, filter2 extracts and returns the central part of the convolution that is the same size as the input matrix. Use the shape parameter to specify an alternate part of the convolution for return.
See Also
conv2 |
Two-dimensional convolution. |
filter |
Filter data with a recursive (IIR) or nonrecursive (FIR) filter. |