lasprs 0.14.0

Library for Acoustic Signal Processing (Rust edition, with optional Python bindings via pyo3)
use crate::config::*;
/// The 'mode' used in computing averaged power spectra. When providing data in
/// blocks to the [AvPowerSpectra] the resulting 'current estimate' responds
/// differently, depending on the model.
#[derive(Copy, Clone, PartialEq, Debug)]
#[cfg_attr(
    feature = "python-bindings",
    gen_stub_pyclass_complex_enum,
    pyclass(get_all, set_all, from_py_object)
)]
pub enum ApsMode {
    /// Averaged over all data provided. New averages can be created by calling
    /// `AvPowerSpectra::reset()`
    AllAveraging {},
    /// In this mode, the `AvPowerSpectra` works a bit like a sound level meter,
    /// where new data is weighted with old data, and old data exponentially
    /// backs off. This mode only makes sense when `tau >> nfft/fs`
    ExponentialWeighting {
        /// Time weighting constant, follows convention of Sound Level Meters.
        /// Means the data is approximately low-pass filtered with a cut-off
        /// frequency f_c of s/tau ≅ 1 → f_c = (2 * pi * tau)^-1.
        tau: Flt,
    },
    /// Spectrogram mode. Only returns the latest estimate(s).
    Spectrogram {},
}
impl Default for ApsMode {
    fn default() -> Self {
        ApsMode::AllAveraging {}
    }
}
#[cfg(feature = "python-bindings")]
#[cfg_attr(feature = "python-bindings", pymethods, gen_stub_pymethods)]
impl ApsMode {
    #[inline]
    fn __eq__(&self, other: &Self) -> bool {
        self == other
    }
}