Control block for Neighborhood Processing Subsystem
The Neighborhood block serves as a control block for the Neighborhood Processing Subsystem block. The Neighborhood Processing Subsystem block iterates over an input matrix. At each iteration, the inport inside the subsystem receives a small matrix representing a configurable window of elements around one element of the input matrix. Use the Neighborhood block parameters to configure the window dimensions and the size of the output matrix.
Neighborhood size — Dimensions of neighborhood window
[3 3] (default) | array of positive scalars
Configure the dimensions of the neighborhood window that the subsystem receives at each iteration. For example, consider this input matrix:
If you set Neighborhood size to
[3 3], then
on the seventh iteration, the Neighborhood Processing Subsystem block
receives this 3-by-3 window that surrounds the seventh element:
Output size — Dimensions of output matrix
Same (default) |
Configure the dimensions of the output matrix.
Same–– The output matrix uses the same dimensions as the input matrix. For elements near the edges, the neighborhood extends beyond the input matrix. Use the Padding option parameter to configure how to pad elements outside the input matrix.
Full–– The output matrix is larger than the input matrix. It includes an element for every neighborhood that includes at least one element from the input matrix, even if the neighborhood center is outside the input matrix. Use the Padding option to configure how to pad elements outside the input matrix.
Valid–– The output matrix is smaller than the input matrix. The output matrix includes only the elements whose neighborhoods fall entirely within the input matrix.
|Type: character vector|
Padding option — Values to use outside of input matrix
Constant (default) |
Configure how to pad values outside the input matrix. When you use the
Same output sizes, some
neighborhoods extend beyond the input matrix and use these padded values.
To fully illustrate the logic of each padding option, each example graphic shows the
5-by-5 input matrix padded with 5-by-5 matrices. In practice, not every padded value is
necessarily part of a neighborhood, depending on the Neighborhood
size and Output size parameters. For example, if you
set Neighborhood size to
[3 3] and
Output size to
Same, the subsystem
uses only the innermost layer of padded values.
Constant–– Use a configurable constant value for elements outside the input matrix. For example, this matrix uses a constant value of
Replicate–– Extend the values of the edge parameters:
Symmetric–– Mirror the input matrix:
Circular–– Repeat the input matrix in a tiled pattern:
|Type: character vector|
To enable this parameter, set Output
Padding constant — Value to use outside input matrix
0 (default) | scalar
Configure the value to use for the
To enable this parameter, set Padding option to
HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has one default HDL architecture.
Introduced in R2022b