Convolve a signal with a kernel using discrete convolution.
Numeric.math.convolve(signal, kernel, method)Computes discrete convolution over the signal entries.
- Parameters:
signal: Input signal samples to convolvekernel: Kernel weights applied across the signalmethod: Output length method for the convolution
- Returns: Convolved signal values
- NumPy: Equivalent to
np.convolve.
import Numeric from '@neabyte/numerix'
const values = Numeric.math.convolve([1, 2, 3], [0, 1, 0.5])
console.log(values)
// [0,1,2.5,4,1.5]import Numeric from '@neabyte/numerix'
const values = Numeric.math.convolve([1, 2, 3], [0, 1, 0.5], 'same')
console.log(values)
// [1,2.5,4]import Numeric from '@neabyte/numerix'
const values = Numeric.math.convolve([1, 2, 3], [0, 1, 0.5], 'valid')
console.log(values)
// [2.5]import Numeric from '@neabyte/numerix'
const values = Numeric.math.convolve([1, 2, 3, 4], [0.25, 0.5, 0.25], 'same')
console.log(values)
// [1,2,3,2.75]