comnum.butterworth_lowpass#
- comnum.butterworth_lowpass(x, fs_hz, fc_hz, *, order=5)#
A Butterworth low-pass IIR filter of order
orderand 3-dB cut-offfc_hzat the sampling ratefs_hz(bilinear transform with the cut-off prewarped, a cascade of second-order sections of unit DC gain), run forward from rest: the anti-aliasing filter of a receiver, such as the fifth-order filter at 40 % of the sampling rate of Ip & Kahn (J. Lightw. Technol. 26(20), 2008).- Parameters:
- Returns:
the filtered samples (complex128), as many as
x.- Return type:
- Raises:
ValueError – for an order outside 1 to 32 or a cut-off outside
(0, fs/2).
Examples
>>> import comnum, numpy as np >>> y = comnum.butterworth_lowpass(np.ones(300), 1e3, 100.0, order=5) >>> round(float(abs(y[-1])), 6) 1.0