28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

filter2<br />

2filter2<br />

Purpose Two-dimensional digital filtering<br />

Syntax Y = filter2(h,X)<br />

Y = filter2(h,X,shape)<br />

Description Y = filter2(h,X) filters the data in X with the two-dimensional FIR filter in<br />

the matrix h. It computes the result, Y, using two-dimensional correlation, and<br />

returns the central part of the correlation that is the same size as X.<br />

2-828<br />

Y = filter2(h,X,shape) returns the part of Y specified by the shape<br />

parameter. shape is a string with one of these values:<br />

Remarks Two-dimensional correlation is equivalent to two-dimensional convolution<br />

with the filter matrix rotated 180 degrees. See the Algorithm section for more<br />

information about how filter2 performs linear filtering.<br />

Algorithm Given a matrix X and a two-dimensional FIR filter h, filter2 rotates your filter<br />

matrix 180 degrees to create a convolution kernel. It then calls conv2, the<br />

two-dimensional convolution function, to implement the filtering operation.<br />

See Also conv2, filter<br />

'full' Returns the full two-dimensional correlation. In this case, Y is<br />

larger than X.<br />

'same' (default) Returns the central part of the correlation. In this<br />

case, Y is the same size as X.<br />

'valid' Returns only those parts of the correlation that are computed<br />

without zero-padded edges. In this case, Y is smaller than X.<br />

filter2 uses conv2 to compute the full two-dimensional convolution of the FIR<br />

filter with the input matrix. By default, filter2 then extracts the central part<br />

of the convolution that is the same size as the input matrix, and returns this as<br />

the result. If the shape parameter specifies an alternate part of the convolution<br />

for the result, filter2 returns the appropriate part.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!