Scipy.signal.convolve in Julia

For 1D signals you may use the convolution in DSP.jl. See Convolutions.

For 2D and multi dimensional arrays you may use the convolutions in ImageFiltering.jl implemented by imfilter().
Pay attention that by default it applies correlation. You may change that by applying reflect() on the kernel.

Personally, I wish for a method which is well optimized (Wrapping Intel IPP) which works on arrays in general and not tied to DSP or Images context.
For small kernels I found StaticKernels.jl which is the fastest I could find on the Julia eco system.

If one day NNLib.jl will support the OneDNN backend (See Use oneDNN · Issue #74 · FluxML/NNlib.jl · GitHub), it might become a good CPU based implementation for convolution / correlation.

2 Likes