Dear all,
I would like to perform an inplace fft-based convolution. But somehow my inplace convolution is slower than the regular one. Can anyone give me hint why?
Thank you for your help,
Best regards
Jf(x) = 0.5exp(-abs(x))
N = 2^12;L = 100
const hx = 2L/N
const X = -L + hx*collect(0:N-1)
const wHat = fft(Jf(X))*hx
function convolution(x)
return ifftshift(real(ifft(wHat .* fft(x))))
end
function convolution!(x)
x_ = fft(x)
@. x_ .= wHat .* x_
ifft!(x_)
@. x .= real(x_)
x .= ifftshift(x)
end
x1 = rand(N)
y1 = @time convolution(x1)
@time convolution!(x1)