Module resample

Module resample 

Source
Expand description

Windowed-sinc resampling as a chain stage (feature dsp).

The free function resample is a linear interpolator — deliberately simple, and fine for conversational speech. But linear interpolation is a first-order filter: its stopband barely attenuates, so content above the target Nyquist aliases back into the speech band. A DSP chain deserves the real thing: [rubato]’s polyphase windowed-sinc resampler (128-tap sinc, Blackman-Harris window, 0.95 cutoff), with the filter’s group delay declared through DspStage::latency_samples instead of ignored.

The stage buffers arbitrary input block sizes into fixed 10 ms chunks (rubato wants fixed input), and rewrites bus.sample_rate to the target rate — stages after it operate at the new rate.

Structs§

SincResampler
High-quality streaming resampler stage.