Signal

Struct Signal 

pub struct Signal<T: SignalType> { /* private fields */ }

Implementations§

§

impl<T: SignalType> Signal<T>

pub fn new(data: Vec<T>) -> Self

pub fn with_sample_rate(data: Vec<T>, sample_rate: f64) -> Self

pub fn from_slice(data: &[T]) -> Self

pub fn zeros(length: usize) -> Self

pub fn ones(length: usize) -> Self

pub fn len(&self) -> usize

pub fn is_empty(&self) -> bool

pub fn data(&self) -> &[T]

pub fn data_mut(&mut self) -> &mut [T]

pub fn to_vec(self) -> Vec<T>

pub fn sample_rate(&self) -> Option<f64>

pub fn set_sample_rate(&mut self, rate: f64)

pub fn metadata(&self) -> &SignalMetadata

pub fn metadata_mut(&mut self) -> &mut SignalMetadata

pub fn map<F>(&self, f: F) -> Self
where F: Fn(T) -> T,

pub fn mean(&self) -> T

pub fn std(&self) -> T

pub fn std_population(&self) -> T

pub fn normalize(&self) -> Self

pub fn energy(&self) -> T

pub fn rms(&self) -> T

pub fn peak_to_peak(&self) -> T

pub fn snr_db(&self, noise: &Signal<T>) -> Option<f64>

pub fn resample(&self, new_length: usize) -> Self

§

impl Signal<f64>

pub fn mean_fast(&self) -> f64

pub fn energy_fast(&self) -> f64

pub fn rms_fast(&self) -> f64

pub fn normalize_inplace(&mut self)

pub fn add_scalar_inplace(&mut self, scalar: f64)

pub fn scale_inplace(&mut self, scalar: f64)

§

impl Signal<f32>

pub fn mean_fast(&self) -> f32

pub fn energy_fast(&self) -> f32

pub fn rms_fast(&self) -> f32

Trait Implementations§

§

impl<T: Clone + SignalType> Clone for Signal<T>

§

fn clone(&self) -> Signal<T>

1.0.0§

fn clone_from(&mut self, source: &Self)

§

impl<T: Debug + SignalType> Debug for Signal<T>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

§

impl<T: SignalType> From<&[T]> for Signal<T>

§

fn from(data: &[T]) -> Self

§

impl<T: SignalType> From<Vec<T>> for Signal<T>

§

fn from(data: Vec<T>) -> Self

Auto Trait Implementations§

§

impl<T> Freeze for Signal<T>

§

impl<T> RefUnwindSafe for Signal<T>
where T: RefUnwindSafe,

§

impl<T> Send for Signal<T>

§

impl<T> Sync for Signal<T>

§

impl<T> Unpin for Signal<T>
where T: Unpin,

§

impl<T> UnwindSafe for Signal<T>
where T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
§

impl<T> From<T> for T

§

fn from(t: T) -> T

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

§

impl<T> IntoEither for T

§

fn into_either(self, into_left: bool) -> Either<Self, Self>

§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

§

impl<T> Pointable for T

§

const ALIGN: usize

§

type Init = T

§

unsafe fn init(init: <T as Pointable>::Init) -> usize

§

unsafe fn deref<'a>(ptr: usize) -> &'a T

§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

§

unsafe fn drop(ptr: usize)

§

impl<T> Same for T

§

type Output = T

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

§

fn is_in_subset(&self) -> bool

§

fn to_subset_unchecked(&self) -> SS

§

fn from_subset(element: &SS) -> SP

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

§

fn to_owned(&self) -> T

§

fn clone_into(&self, target: &mut T)

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,