Skip to contents

This function calculates the 2D Convolution of two matrices `a` and `b` using compiled Fortran subroutine.

Usage

conv2D_f(a, b)

Arguments

a

A matrix (2D array) of values.

b

A matrix (2D array) of values.

Value

A matrix representing the 2D cross-correlation of the input matrices.

Author

Ahmed Homoudi

Examples

a <- matrix(c(1, 2, 3, 4), ncol = 2)
b <- matrix(c(5, 6, 7, 8), ncol = 2)
conv2D_f(a, b)
#>      [,1] [,2] [,3]
#> [1,]    5   22   21
#> [2,]   16   60   52
#> [3,]   12   40   32