fftconvolve

Function fftconvolve 

Source
pub fn fftconvolve<F: Float + FftNum>(
    in1: &[F],
    in2: &[F],
    mode: ConvolveMode,
) -> Vec<F>
Expand description

Performs FFT-based convolution on two slices of floating point values.

According to Python docs, this is generally much faster than direct convolution for large arrays (n > ~500), but can be slower when only a few output values are needed. We only implement the FFT version in Rust for now.

§Arguments

  • in1: First input signal
  • in2: Second input signal
  • mode: Convolution mode (currently only Full is supported)

§Returns

A Vec containing the discrete linear convolution of in1 with in2. For Full mode, the output length will be in1.len() + in2.len() - 1.