Struct pm_remez::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> Freeze for BandSetting<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for BandSetting<T>

§

impl<T> !Send for BandSetting<T>

§

impl<T> !Sync for BandSetting<T>

§

impl<T> Unpin for BandSetting<T>
where T: Unpin,

§

impl<T> !UnwindSafe for BandSetting<T>

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<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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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