pub struct TimeSignal { /* private fields */ }Implementations§
Source§impl TimeSignal
impl TimeSignal
pub fn energy_per_channel(&self) -> Vec<f64>
pub fn power_per_channel(&self) -> Vec<f64>
pub fn rms_per_channel(&self) -> Vec<f64>
pub fn normalize_peak(&mut self, peak_level: f64)
pub fn normalize_peak_db(&mut self, peak_db: f64)
Source§impl TimeSignal
impl TimeSignal
pub fn new(data: Array2<f64>, sample_rate: f64) -> Result<Self, SignalError>
pub fn zeros( num_channels: usize, num_time_steps: usize, sample_rate: f64, ) -> Result<Self, SignalError>
pub fn from_real_data( data: RealData, sample_rate: f64, ) -> Result<Self, SignalError>
pub fn comment(&self) -> Option<&str>
pub fn set_comment(&mut self, comment: Option<&str>)
pub fn channel_label(&self, channel: usize) -> Option<&str>
pub fn set_channel_label(&mut self, channel: usize, label: Option<&str>)
pub fn sample_rate(&self) -> f64
pub fn num_channels(&self) -> usize
pub fn num_time_steps(&self) -> usize
pub fn num_freq_bins(&self) -> usize
pub fn length_in_seconds(&self) -> f64
Sourcepub fn time_steps(&self) -> CowArray<'_, f64, Ix1>
pub fn time_steps(&self) -> CowArray<'_, f64, Ix1>
Time of each sample in seconds. See RealData::x_data for when this
allocates. Use time_axis for single values.
pub fn time_data(&self) -> ArrayView2<'_, f64>
pub fn time_data_mut(&mut self) -> ArrayViewMut2<'_, f64>
pub fn data(&self) -> &RealData
pub fn channel(&self, ch: usize) -> ArrayView1<'_, f64>
pub fn channel_mut(&mut self, ch: usize) -> ArrayViewMut1<'_, f64>
pub fn channel_iter(&self) -> AxisIter<'_, f64, Ix1> ⓘ
pub fn channel_iter_mut(&mut self) -> AxisIterMut<'_, f64, Ix1> ⓘ
pub fn iter(&self) -> Iter<'_, f64, Ix2> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, f64, Ix2> ⓘ
pub fn into_time(self) -> TimeSignal
Sourcepub fn into_freq(self) -> FreqSignal
pub fn into_freq(self) -> FreqSignal
Transform to the frequency domain. Equivalent to TimeSignal::to_freq.
Sourcepub fn to_freq(&self) -> FreqSignal
pub fn to_freq(&self) -> FreqSignal
Transform to the frequency domain without consuming self.
Trait Implementations§
Source§impl AbsDiffEq for TimeSignal
impl AbsDiffEq for TimeSignal
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl Clone for TimeSignal
impl Clone for TimeSignal
Source§impl Debug for TimeSignal
impl Debug for TimeSignal
Source§impl<'de> Deserialize<'de> for TimeSignal
Available on crate feature serde only.Reads through TimeSignal::new, so the same checks apply.
impl<'de> Deserialize<'de> for TimeSignal
Available on crate feature
serde only.Reads through TimeSignal::new, so the same checks apply.
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TimeSignal
impl Display for TimeSignal
Source§impl<'a> IntoIterator for &'a TimeSignal
impl<'a> IntoIterator for &'a TimeSignal
Source§impl<'a> IntoIterator for &'a mut TimeSignal
impl<'a> IntoIterator for &'a mut TimeSignal
Source§impl IntoIterator for TimeSignal
impl IntoIterator for TimeSignal
Source§impl PartialEq for TimeSignal
impl PartialEq for TimeSignal
Source§impl Serialize for TimeSignal
Available on crate feature serde only.Stored form: the samples plus what cannot be derived from them. The time
axis follows from the sample rate and is rebuilt when reading, so a file
cannot contain an axis that does not fit the signal.
impl Serialize for TimeSignal
Available on crate feature
serde only.Stored form: the samples plus what cannot be derived from them. The time axis follows from the sample rate and is rebuilt when reading, so a file cannot contain an axis that does not fit the signal.
impl StructuralPartialEq for TimeSignal
Auto Trait Implementations§
impl Freeze for TimeSignal
impl RefUnwindSafe for TimeSignal
impl Send for TimeSignal
impl Sync for TimeSignal
impl Unpin for TimeSignal
impl UnsafeUnpin for TimeSignal
impl UnwindSafe for TimeSignal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more