Y = filter2(H,X,shape) returns
a subsection of the filtered data according to shape.
For example, Y = filter2(H,X,'valid') returns only
filtered data computed without zero-padded edges.
H — Coefficients of rational transfer function matrix
Coefficients of the rational transfer function, specified as
a matrix.
Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical Complex Number Support: Yes
X — Input data matrix
Input data, specified as a matrix. If one or both of X and H are
of type single, then the output is also of type single.
Otherwise, filter2 returns type double.
Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical Complex Number Support: Yes
shape — Subsection of filtered data 'same' (default) | 'full' | 'valid'
Subsection of the filtered data, specified as one of these values:
'same' — Return the central
part of the filtered data, which is the same size as X.
'full' — Return the full
2-D filtered data.
'valid' — Return only parts
of the filtered data that are computed without zero-padded edges.
Algorithms
The filter2 function filters data by taking
the 2-D convolution of the input X and the coefficient
matrix H rotated 180 degrees. Specifically, filter2(H,X,shape) is
equivalent to conv2(X,rot90(H,2),shape).
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
GPU Arrays Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs H and X must be single or
double arrays. Both real and complex types are supported.