Trait basic_dsp::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§
sourcefn convolve<B>(
&mut self,
buffer: &mut B,
impulse_response: C,
ratio: T,
len: usize
)where
B: for<'b> Buffer<'b, S, T>,
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:
VectorMustBeComplex
: ifself
is in real number space overlap_discardimpulse_response
is in complex number space.VectorMustBeInTimeDomain
: ifself
is in frequency domain.
Object Safety§
This trait is not object safe.