Struct pm_remez::BandSetting
source · pub struct BandSetting<T> { /* private fields */ }
Expand description
Band with desired response and weight Setting
s.
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 Setting
s
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 BandSetting
s 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
.