Skip to main content

BandSetting

Struct BandSetting 

Source
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>

Source

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.

Source

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.

Source

pub fn band(&self) -> Band<T>

Returns the Band associated to this BandSetting.

Source

pub fn set_band(&mut self, band: Band<T>)

Sets the Band associated to this BandSetting.

Source

pub fn set_desired_response(&mut self, desired_response: Setting<T>)

Sets the desired response used by this BandSetting.

Source

pub fn set_weight(&mut self, weight: Setting<T>)

Sets the weight function used by this BandSetting.

Trait Implementations§

Source§

impl<T: Debug> Debug for BandSetting<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V