| MATLAB Functions | Help Desk |
filter2
Two-dimensional digital filtering
Y = filter2(B,X)
Y = filter2(B,X,'shape')
Y = filter2(B,X)
filters the data in X with the two-dimensional FIR filter 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 via two-dimensional convolution with size specified by shape--one of three strings which determines the size of the output matrix:
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 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.
conv2 Two-dimensional convolution
filter Filter data with an infinite impulse response (IIR) or
finite impulse response (FIR) filter