Displaying 1 result from an estimated 1 matches for "myconvolve".
Did you mean:
my_convolve
2000 Jan 28
0
convolution bug (PR#408)
...behaviour
is
correlation. This is a bug.
The default argument conj should be set to FALSE.
The zero-padding should be on the right for linear convolution (don't ask me
why you call this type="open"; I suggest type="linear").
Here is what I expect linear convolution to do:
myconvolve<-function (x,h)
{
nx <- length(x)
nh <- length(h)
#zero pad
if(nx>nh)
{
x <- c(x,rep(0, nh-1))
h<-c(h,rep(0,nx-1))
}
else
{
h <- c(h,rep(0, nx-1))
x<-c(x,rep(0,nh-1))
}
x <- fft(fft(x) * fft(...