pub struct Interpolator { /* private fields */ }Expand description
The band-limited interpolation a clip played at another speed reads its
source through: the same Kaiser-windowed sinc as Resampler (16 taps a
side at unity, cutoff 0.97 of the Nyquist frequency, beta 9), at any real
source position. Played faster than unity, the cutoff falls to the output’s
Nyquist frequency and the filter widens in proportion, as a falling rate
does, so what the speed raises past the output’s Nyquist frequency is
removed rather than folded back. Slower, the source’s Nyquist frequency
bounds it, so no image of the source’s spectrum is heard.
Every weight comes from one table computed with libm’s portable
functions, interpolated linearly, and every sum runs in one fixed order,
so the same samples give bit-identical output natively and in wasm.
Implementations§
Source§impl Interpolator
impl Interpolator
Sourcepub fn new(speed: f64) -> Self
pub fn new(speed: f64) -> Self
The filter for a clip playing speed source samples per output
sample. A speed that is not a positive finite number takes the unity
filter.