Skip to content

Rate

Changes the rate by up / down with a Kaiser-windowed FIR, as scipy.signal.resample_poly. The output has ceil(samples * up / down) samples.

y = dspk.ops.resample.resample_poly(x, 2, 3)

Lowers the rate by an integer factor behind an anti-alias filter, as scipy.signal.decimate(x, q, zero_phase=True). Python only; in a spec, use resample.

lfp = dspk.ops.resample.decimate(x, 30) # (channels, ceil(samples / 30))

With ftype="iir", samples near the ends can differ slightly from SciPy’s, which pads differently.

Worked example: Resampling.