Skip to main content

Sample

Trait Sample 

Source
pub trait Sample: Copy + Debug {
    // Required methods
    fn zero() -> Self;
    fn scaled(self, amplitude: f64, offset: Self) -> Self;
}
Expand description

A type a source can emit: real (f64) or complex (Complex<f64>) samples.

Required Methods§

Source

fn zero() -> Self

The additive identity, used as the default offset.

Source

fn scaled(self, amplitude: f64, offset: Self) -> Self

amplitude * self + offset.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Sample for Complex<f64>

Source§

fn zero() -> Complex<f64>

Source§

fn scaled(self, amplitude: f64, offset: Complex<f64>) -> Complex<f64>

Source§

impl Sample for f64

Source§

fn zero() -> f64

Source§

fn scaled(self, amplitude: f64, offset: f64) -> f64

Implementors§