Trait basic_dsp::Convolution [] [src]

pub trait Convolution<T, C>: DataVector<T> where T: RealNumber {
    fn convolve(self, impulse_response: C, ratio: T, len: usize) -> VecResult<Self>;
}

Provides a convolution operation for data vectors.

Required Methods

fn convolve(self, impulse_response: C, ratio: T, len: usize) -> VecResult<Self>

Convolves self with the convolution function impulse_response. For performance consider to to use FrequencyMultiplication instead of this operation depending on len.

An optimized convolution algorithm is used if 1.0 / ratio is an integer (inside a 1e-6 tolerance) and len is smaller than a threshold (202 right now).

Failures

VecResult may report the following ErrorReason members:

  1. VectorMustBeComplex: if self is in real number space but impulse_response is in complex number space.
  2. VectorMustBeInTimeDomain: if self is in frequency domain.

Implementors