pub struct FilterConfig {
pub filter_type: FilterType,
pub cutoff: f64,
pub q: f64,
pub sample_rate: f64,
pub gain: Option<f64>,
}Expand description
Configuration parameters for a filter.
- For most filters,
gainis ignored. - For a Peak filter, a non-zero gain in dB is required.
Fields§
§filter_type: FilterType§cutoff: f64§q: f64§sample_rate: f64§gain: Option<f64>Implementations§
Source§impl FilterConfig
impl FilterConfig
Sourcepub fn new(
filter_type: FilterType,
cutoff: f64,
q: f64,
sample_rate: f64,
gain: Option<f64>,
) -> Result<Self, EEGError>
pub fn new( filter_type: FilterType, cutoff: f64, q: f64, sample_rate: f64, gain: Option<f64>, ) -> Result<Self, EEGError>
Creates a new FilterConfig.
§Errors
- Returns an error if the sampling rate or Q factor are not positive.
- Returns an error if the cutoff frequency is not below the Nyquist limit.
- For Peak filters, returns an error if gain is not provided.
Trait Implementations§
Source§impl Clone for FilterConfig
impl Clone for FilterConfig
Source§fn clone(&self) -> FilterConfig
fn clone(&self) -> FilterConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FilterConfig
impl RefUnwindSafe for FilterConfig
impl Send for FilterConfig
impl Sync for FilterConfig
impl Unpin for FilterConfig
impl UnwindSafe for FilterConfig
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