conv: Compute convolution function using FFT, similar to the...

Description Usage Arguments Value References Examples

View source: R/conv.R

Description

Compute convolution function using FFT, similar to the function 'conv' in matlab

Usage

1
conv(u, v, shape = c("same", "full"))

Arguments

u

vector

v

vector

shape

if 'same', return central part of the convolution,the same size as u; ortherwise return the whole sequence with size lenth(u)+length(v)-1

Value

a vector of convolution, as specified by shape.

References

Matlab document on 'conv' https://www.mathworks.com/help/matlab/ref/conv.html

Examples

1
2
3
u = c(-1,2,3,-2,0,1,2)
v = c(2,4,-1,1)
w = conv(u,v,'same')

mSTEM documentation built on Oct. 2, 2019, 5:03 p.m.