pub struct BandSetting<T> { /* private fields */ }Expand description
Band with desired response and weight Settings.
This struct defines a band (a closed subinterval of [0.0, 0.5] in which the
Parks-McClellan algorithm tries to minimize the maximum weighted error) to
which a desired response and a weight function in the form of Settings
are attached. The struct is used in one of the coding styles supported by
this crate. In such coding style, the Parks-McClellan algorithm parameters
are defined in terms of a list of BandSettings by calling the
pm_parameters function.
Implementations§
Source§impl<T: Float> BandSetting<T>
impl<T: Float> BandSetting<T>
Sourcepub fn new(
band_begin: T,
band_end: T,
desired_response: Setting<T>,
) -> Result<BandSetting<T>>
pub fn new( band_begin: T, band_end: T, desired_response: Setting<T>, ) -> Result<BandSetting<T>>
Creates a new BandSetting with default weight.
The band_begin and band_end parameter indicate the being and the end
of the band respectively. The desired_response parameter gives the
desired response in this band. The weight when using this constructor is
set to constant(T::one()). A custom weight can be defined using the
constructor BandSetting::with_weight instead, or by calling
BandSetting::set_weight.
Sourcepub fn with_weight(
band_begin: T,
band_end: T,
desired_response: Setting<T>,
weight: Setting<T>,
) -> Result<BandSetting<T>>
pub fn with_weight( band_begin: T, band_end: T, desired_response: Setting<T>, weight: Setting<T>, ) -> Result<BandSetting<T>>
Creates a new BandSetting with a custom weight.
The weight parameter gives the weight function in this band. The
remaining parameters behave as in BandSetting::new.
Sourcepub fn band(&self) -> Band<T>
pub fn band(&self) -> Band<T>
Returns the Band associated to this BandSetting.
Sourcepub fn set_band(&mut self, band: Band<T>)
pub fn set_band(&mut self, band: Band<T>)
Sets the Band associated to this BandSetting.
Sourcepub fn set_desired_response(&mut self, desired_response: Setting<T>)
pub fn set_desired_response(&mut self, desired_response: Setting<T>)
Sets the desired response used by this BandSetting.
Sourcepub fn set_weight(&mut self, weight: Setting<T>)
pub fn set_weight(&mut self, weight: Setting<T>)
Sets the weight function used by this BandSetting.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for BandSetting<T>
impl<T> !Send for BandSetting<T>
impl<T> !Sync for BandSetting<T>
impl<T> !UnwindSafe for BandSetting<T>
impl<T> Freeze for BandSetting<T>where
T: Freeze,
impl<T> Unpin for BandSetting<T>where
T: Unpin,
impl<T> UnsafeUnpin for BandSetting<T>where
T: UnsafeUnpin,
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> 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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.