wconv {gsignal} | R Documentation |
1-D or 2-D convolution
Description
Compute the one- or two-dimensional convolution of two vectors or matrices.
Usage
wconv(
type = c("1d", "2d", "row", "column"),
a,
b,
shape = c("full", "same", "valid")
)
Arguments
type |
Numeric or character, specifies the type of convolution to perform:
|
a , b |
Input vectors or matrices, coerced to numeric. |
shape |
Subsection of convolution, partially matched to:
|
Value
Convolution of input matrices, returned as a matrix or a vector.
Author(s)
Lukas Reichlin, lukas.reichlin@gmail.com.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.
See Also
Examples
a <- matrix(1:16, 4, 4)
b <- matrix(1:9, 3,3)
w <- wconv('2', a, b)
w <- wconv('1', a, b, 'same')
w <- wconv('r', a, b)
w <- wconv('r', a, c(0,1), 'same')
w <- wconv('c', a, c(0,1), 'valid')