pub struct FilterSpec {
pub design: FilterDesign,
pub mode: FilterMode,
pub start: FilterStart,
}Expand description
A filter to design, the direction(s) it runs in, and where forward passes start.
Fields§
§design: FilterDesign§mode: FilterMode§start: FilterStartImplementations§
Source§impl FilterSpec
impl FilterSpec
pub fn butterworth(order: usize, band: FilterBand) -> Self
pub fn bandpass(low_hz: f64, high_hz: f64) -> Self
pub fn highpass(cutoff_hz: f64) -> Self
pub fn lowpass(cutoff_hz: f64) -> Self
pub fn bandstop(low_hz: f64, high_hz: f64) -> Self
pub fn chebyshev1(order: usize, ripple_db: f64, band: FilterBand) -> Self
Sourcepub fn bessel(order: usize, band: FilterBand) -> Self
pub fn bessel(order: usize, band: FilterBand) -> Self
Bessel of order per edge (phase-normalised, as scipy.signal.bessel), zero phase.
pub fn notch(freq_hz: f64, q: f64) -> Self
pub fn sos(sos: Sos) -> Self
Sourcepub fn with_order(self, new_order: usize) -> Self
pub fn with_order(self, new_order: usize) -> Self
Returns the same filter with order (Butterworth / Chebyshev; ignored for notch / explicit SOS).
pub fn with_mode(self, mode: FilterMode) -> Self
Sourcepub fn with_start(self, start: FilterStart) -> Self
pub fn with_start(self, start: FilterStart) -> Self
Returns the same filter starting forward passes at start.
Sourcepub fn design(&self, sample_rate: f64) -> Result<Sos, OpsError>
pub fn design(&self, sample_rate: f64) -> Result<Sos, OpsError>
Designs the second-order sections for sample_rate Hz, validating the parameters.
§Errors
OpsError when the design is invalid at sample_rate: non-positive sample rate, zero
order, a cutoff outside (0, Nyquist), band edges out of order, a bad q or ripple.
Explicit sections fail Sos::validate.
Sourcepub fn settling(&self, sample_rate: f64) -> Result<(usize, usize), OpsError>
pub fn settling(&self, sample_rate: f64) -> Result<(usize, usize), OpsError>
(left, right) samples needed around a chunk for its interior to match whole-recording
filtering (impulse response decayed below DEFAULT_SETTLING_TOLERANCE).
§Errors
As Self::design.
Trait Implementations§
Source§impl Clone for FilterSpec
impl Clone for FilterSpec
Source§impl Debug for FilterSpec
impl Debug for FilterSpec
Source§impl PartialEq for FilterSpec
impl PartialEq for FilterSpec
impl StructuralPartialEq for FilterSpec
Auto Trait Implementations§
impl Forget for FilterSpec
impl Freeze for FilterSpec
impl Move for FilterSpec
impl RefUnwindSafe for FilterSpec
impl Send for FilterSpec
impl Sync for FilterSpec
impl Unpin for FilterSpec
impl UnsafeUnpin for FilterSpec
impl UnwindSafe for FilterSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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