0

I'm trying to build some digital filter designs but I currently have a technical problem. I have narrowed it down to building the high-pass filter. Here is a minimal example, building a 3rd order high pass Butterworth filter

    import numpy as np
    import scipy.signal as sig
    import control

    mydt = 0.25e-3
    hpfilter_signal = sig.butter(3, 2., btype="highpass", fs=1/mydt)
    hpfilter_control = control.tf(*hpfilter_signal, mydt)

    dump = control.bode(hpfilter_control,  Hz=True, label="", wrap_phase=True)

On the resulting bode plot, one can see large errors at the low frequency end

On this bode plot, we can see what looks like a lot of "noise" in amplitude and phase at the low frequency end. I don't know if this comes from scipy.signal.butter, or if it comes from the python control implementation of the transfer function. This looks like numerical quantization errors, but it seems to appear quite early. In practice, when simulating a system (that has to work in conjunction to a double integrator) in the time domain, the system diverges. Is this a fundamental limitation of such filters? Is this a bug? How can I go around it? Thanks in advance.

The problem seems to arise mostly with band pass and high-pass filters of order 3 or more. Converting to a second order series of transfer functions seems to improve a little bit, but the problem remains.

Echo20127
  • 23
  • 3

0 Answers0