Struct pm_remez::PMParameters
source · pub struct PMParameters<T, D, W> { /* private fields */ }
Expand description
Parks-McClellan design parameters struct.
This struct is one of the two ways (together with the
pm_parameters
function used with a list of
BandSetting
objects) in which the parameters to
execute the Parks-McClellan algorithm can be designed. This struct specifies
custom closures for the desired response and weight function, represented by
the type parameters D
and W
. The type parameter T
is the scalar type
used for computation. Typically it should implement the Float
and
FloatConst
traits.
Implementations§
source§impl<T: Float, D, W> PMParameters<T, D, W>
impl<T: Float, D, W> PMParameters<T, D, W>
sourcepub fn new(
num_taps: usize,
bands: Vec<Band<T>>,
desired_response: D,
weights: W
) -> Result<Self>
pub fn new( num_taps: usize, bands: Vec<Band<T>>, desired_response: D, weights: W ) -> Result<Self>
Creates new design parameters for the Parks-McClellan algorithm.
The num_taps
argument indicates the number of taps of the FIR
filter. The bands
argument is the list of sub-bands of the interval
[0.0, 0.5] on which the maximum weighted error is minimized. The
desired_response
and weight
arguments indicate the desired response
and weight function of the filter. Typically these should be closures
Fn(T) -> T
.
Other parameters required for the Parks-McClellan algorithm are given
default values and can be changed using the methods defined by the
ParametersBuilder
trait. By default, the symmetry of the FIR filter
taps is set to even, and the other parameters that can be changed by
this trait are given reasonable default values.
Trait Implementations§
source§impl<T, D, W> DesignParameters<T> for PMParameters<T, D, W>
impl<T, D, W> DesignParameters<T> for PMParameters<T, D, W>
source§fn desired_response(&self) -> impl Fn(T) -> T
fn desired_response(&self) -> impl Fn(T) -> T
source§fn chebyshev_proxy_degree(&self) -> usize
fn chebyshev_proxy_degree(&self) -> usize
source§fn max_iterations(&self) -> usize
fn max_iterations(&self) -> usize
pm_remez
.source§fn flatness_threshold(&self) -> T
fn flatness_threshold(&self) -> T
source§impl<T, D, W> ParametersBuilder<T> for PMParameters<T, D, W>
impl<T, D, W> ParametersBuilder<T> for PMParameters<T, D, W>
source§fn set_symmetry(&mut self, symmetry: Symmetry) -> &mut Self
fn set_symmetry(&mut self, symmetry: Symmetry) -> &mut Self
source§fn set_chebyshev_proxy_degree(&mut self, degree: usize) -> &mut Self
fn set_chebyshev_proxy_degree(&mut self, degree: usize) -> &mut Self
source§fn set_max_iterations(&mut self, max_iterations: usize) -> &mut Self
fn set_max_iterations(&mut self, max_iterations: usize) -> &mut Self
pm_remez
.