If I apply a digital Bessel filter to a perfect step function, I get something that looks like the following:
The green line is the input step response data sampled at 500kHz, the red line is obtained using the scipy.signal.lfitler
routine with a 8-pole Bessel low-pass filter at 10kHz, and the blue line is the result of the same filter but using the scipy.signal.filtfilt
.
Given the signal (either red or blue) is there an analytical form for the response that would allow me to extract the cutoff frequency using a nonlinear fit? Both functions look like a sigmoidal of some kind - is there an analytical formula for it?
The form
seems to fit both cases quite closely, but not perfectly, and it's not clear what relation the time constant bears to the cutoff frequency.
If I fit that form to the filtfilt
data, I get a linear relationship between the time constant for the fit, and the time constant for the filter (1/fc), with a slope of about 1/35. I imagine that slope will be a function of the filter order. Can anyone suggest a better analytical form for the fit function?