Trait basic_dsp_vector::Convolution
[−]
[src]
pub trait Convolution<'a, S, T, C: ?Sized + 'a> where S: ToSliceMut<T>, T: RealNumber { fn convolve<B>(&mut self, buffer: &mut B, impulse_response: &C, ratio: T, len: usize) where B: Buffer<S, T>; }
Provides a convolution operations.
Required Methods
fn convolve<B>(&mut self, buffer: &mut B, impulse_response: &C, ratio: T, len: usize) where B: Buffer<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:
VectorMustBeComplex: ifselfis in real number space butimpulse_responseis in complex number space.VectorMustBeInTimeDomain: ifselfis in frequency domain.
Implementors
impl<'a, S, T, N, D> Convolution<'a, S, T, RealImpulseResponse<T>> for DspVec<S, T, N, D> where S: ToSliceMut<T>, T: RealNumber + 'a, N: NumberSpace, D: TimeDomainimpl<'a, S, T, N, D> Convolution<'a, S, T, ComplexImpulseResponse<T>> for DspVec<S, T, N, D> where S: ToSliceMut<T>, T: RealNumber + 'a, N: ComplexNumberSpace, D: TimeDomain