MATLAB Functions Help Desk

filter2

Purpose

Two-dimensional digital filtering

Syntax

Description

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:

Algorithm

The 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.

See Also

conv2       Two-dimensional convolution

filter      Filter data with an infinite impulse response (IIR) or finite impulse response (FIR) filter



[ Previous | Help Desk | Next ]