pub struct PolyphaseIntegerResampler<T: IsAnalytic> { /* private fields */ }Expand description
Streaming rational-ratio polyphase resampler: upsample by up_rate, low-pass filter, keep every
down_rate-th sample (up_rate / down_rate is reduced to lowest terms). The output equals
SciPy’s upfirdn(up · h, x, up, down), the core of resample_poly, and arrives as soon as the
inputs it needs have; flush emits the rest of the filter’s tail. Without explicit taps a
Kaiser-window low-pass filter with cutoff 1 / max(up, down) of Nyquist and 60 dB attenuation
is designed.
Implementations§
Source§impl<T: IsAnalytic> PolyphaseIntegerResampler<T>
impl<T: IsAnalytic> PolyphaseIntegerResampler<T>
Sourcepub fn new(
up_rate: usize,
down_rate: usize,
fir_taps: Option<&[f64]>,
) -> Result<Self, ErrorsJSL>
pub fn new( up_rate: usize, down_rate: usize, fir_taps: Option<&[f64]>, ) -> Result<Self, ErrorsJSL>
The new method initializes a PolyphaseIntegerResampler instance with the specified upsampling rate, downsampling rate, and optional FIR filter taps.
If FIR filter taps are not provided, it designs a low-pass FIR filter using the Kaiser window method, with a cutoff frequency determined by the maximum of the upsampling and downsampling rates.
The number of taps is estimated based on the desired attenuation and the width of the transition band,