Convolution

Trait Convolution 

Source
pub trait Convolution<'a, S, T, C>
where C: 'a, S: ToSliceMut<T>, T: RealNumber,
{ // Required method fn convolve<B>( &mut self, buffer: &mut B, impulse_response: C, ratio: T, len: usize, ) where B: for<'b> Buffer<'b, S, T>; }
Expand description

Provides a convolution operations.

Required Methods§

Source

fn convolve<B>( &mut self, buffer: &mut B, impulse_response: C, ratio: T, len: usize, )
where B: for<'b> Buffer<'b, S, T>,

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

TransRes may report the following ErrorReason members:

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, S, T, N, D> Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>> for DspVec<S, T, N, D>
where S: ToSliceMut<T>, T: RealNumber, N: ComplexNumberSpace, D: TimeDomain, DspVec<S, T, N, D>: TimeToFrequencyDomainOperations<S, T> + Clone + ConvolutionOps<DspVec<InlineVector<T>, T, N, D>, S, T, N, D>,

Source§

impl<'a, S, T, N, D> Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>> for DspVec<S, T, N, D>
where S: ToSliceMut<T>, T: RealNumber, N: NumberSpace, D: TimeDomain, DspVec<S, T, N, D>: TimeToFrequencyDomainOperations<S, T> + Clone + ConvolutionOps<DspVec<InlineVector<T>, T, N, D>, S, T, N, D>,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>> for Matrix2xN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>> for Matrix3xN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>> for Matrix4xN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn ComplexImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>> for Matrix2xN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>> for Matrix3xN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>> for Matrix4xN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,

Source§

impl<'a, V, S, T> Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>> for MatrixMxN<V, S, T>
where V: Vector<T> + Convolution<'a, S, T, &'a dyn RealImpulseResponse<T>>, S: ToSliceMut<T>, T: RealNumber,