sdr.Resampler(up: int, down: int, taps: 'kaiser' | 'linear' | 'linear-matlab' | 'zoh' | ArrayLike = 'kaiser', streaming: bool = False)

Creates a polyphase FIR rational resampling filter.

Parameters:
up: int

The interpolation rate \(P\).

down: int

The decimation rate \(Q\).

taps: 'kaiser' | 'linear' | 'linear-matlab' | 'zoh' | ArrayLike = 'kaiser'

The multirate filter design specification.

  • "kaiser": The multirate filter is designed using multirate_taps() with arguments up and down.

  • "linear": The multirate filter is designed to linearly interpolate between samples. The filter coefficients are a length-\(2P\) linear ramp \(\frac{1}{P} [0, ..., P-1, P, P-1, ..., 1]\). The first output sample aligns with the first input sample.

  • "linear-matlab": The multirate filter is designed to linearly interpolate between samples. The filter coefficients are a length-\(2P\) linear ramp \(\frac{1}{P} [1, ..., P-1, P, P-1, ..., 0]\). This is method MATLAB uses. The first output sample is advanced from the first input sample.

  • "zoh": The multirate filter is designed to be a zero-order hold. The filter coefficients are a length-\(P\) array of ones.

  • npt.ArrayLike: The multirate filter feedforward coefficients \(h_i\).

streaming: bool = False

Indicates whether to use streaming mode. In streaming mode, previous inputs are preserved between calls to __call__().