sdr.multirate_taps(up: int, down: int = 1, half_length: int = 12, A_stop: float = 80) NDArray[float_]

Computes the multirate FIR filter that achieves rational resampling by \(P/Q\).

Note

This filter can be used with sdr.Interpolator, sdr.Decimator, or sdr.Resampler.

Parameters:
up: int

The interpolation rate \(P\).

down: int = 1

The decimation rate \(Q\).

half_length: int = 12

The half-length of the polyphase filters.

A_stop: float = 80

The stopband attenuation \(A_{\text{stop}}\) in dB.

Returns:

The multirate FIR filter \(h[n]\).

References

Examples

Design a multirate FIR filter for rational resampling by 11/3.

In [1]: h = sdr.multirate_taps(11, 3)

In [2]: plt.figure(figsize=(8, 4)); \
   ...: sdr.plot.impulse_response(h);
   ...: 

In [3]: plt.figure(figsize=(8, 4)); \
   ...: sdr.plot.magnitude_response(h);
   ...: 
../../_images/sdr_multirate_fir_1.png ../../_images/sdr_multirate_fir_2.png