Struct basic_dsp_vector::conv_types::ForeignRealConvolutionFunction
[−]
[src]
pub struct ForeignRealConvolutionFunction<T> where T: RealNumber { pub conv_function: extern fn(*const c_void, T) -> T, pub conv_data: usize, pub is_symmetric: bool, }
A real function which can be constructed outside this crate.
Fields
conv_function: extern fn(*const c_void, T) -> T
The function
conv_data: usize
The data which is passed to the function.
Actual data type is a const* c_void
, but Rust doesn't allow that
because it's unsafe so we store
it as usize
and transmute it when necessary. Callers should make
very sure safety is guaranteed.
is_symmetric: bool
Indicates whether this function is symmetric around 0 or not.
Symmetry is defined as self.calc(x) == self.calc(-x)
.
Methods
impl<T> ForeignRealConvolutionFunction<T> where T: RealNumber
[src]
unsafe fn new(function: extern fn(*const c_void, T) -> T,
function_data: *const c_void,
is_symmetric: bool)
-> Self
function_data: *const c_void,
is_symmetric: bool)
-> Self
Creates a new real function
Trait Implementations
impl<T> RealImpulseResponse<T> for ForeignRealConvolutionFunction<T> where T: RealNumber
[src]
fn is_symmetric(&self) -> bool
Indicates whether this function is symmetric around 0 or not. Symmetry is defined as self.calc(x) == self.calc(-x)
. Read more
fn calc(&self, x: T) -> T
Calculates the convolution for a data point
impl<T> RealFrequencyResponse<T> for ForeignRealConvolutionFunction<T> where T: RealNumber
[src]
fn is_symmetric(&self) -> bool
Indicates whether this function is symmetric around 0 or not. Symmetry is defined as self.calc(x) == self.calc(-x)
. Read more
fn calc(&self, x: T) -> T
Calculates the convolution for a data point