# Analytical expression for step response of digital bessel filter

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?

• How about looking at the frequency response of your filter? Since you are interested in the cut -off frequency and filter order observing your filter behavior in the frequency instead of the time domain may be a better choice. The frequency response of the Bessel filter is given by Bessel polynomials. – Michael C. Jan 27 '17 at 15:20
• That's probably how I would arrive at an analytical expression for the time-domain response, by transforming the frequency domain one. Just not sure how to go about it. Doing some reading now. – KBriggs Jan 27 '17 at 16:48
• How would you extract the cut-off frequency from the step response? Not that it's impossible, but you should really better check the frequency response (as suggested in another comment). – Matt L. Jan 31 '17 at 16:35
• I don't really care about the cutoff frequency, I am interested in having a functional form that I can fit to a step response. The idea is that I have repeated step responses, close enough together that they do not completely settle in between, and I need to fit the amplitudes of the unfiltered steps. That requires a functional form for a nonlinear fit, and one of the parameters (really the only one I don't have an analytical expression for) is the rise time of the filter - which will certainly be related to the reciprocal cutoff frequency, but it's unclear how. – KBriggs Jan 31 '17 at 16:46
• You can see a similar application, with a different time response, here: pages.nist.gov/mosaic//html/doc/Algorithms.html#adept-2-state – KBriggs Jan 31 '17 at 16:47

Yes, there is an analytical response, though it might not look like you would like to have it:

Your Bessel Filter can be written in Z-Domain as

$$H(z)=K\frac{\prod_{i=0}^7(z-z_i)}{\prod_{i=0}^7(z-p_i)}$$

where $z_i$ are the zeros and $p_i$ are the poles of the z-Transform. Now, to get the step response, you "simply" need to calculate

$$h[n]=\mathcal{Z}^{-1}\left(\frac{z}{z-1}H(z)\right).$$

i.e. you multiply the Z-Transform of the filter with the Z-Transform of a unit-step (which is $z/(z-1)$) and calculate the inverse Z-Transform. If you have access to Mathematica etc. it can do it for you. If not, you would need to perform partial fraction decomposition of the expression and then perform inverse Z-Transform of the several partial fractions.

• Nice and ugly, more or less what I expected. Thanks. I think the analytical form I suggested in the OP is probably a decent enough approximation, though I'll have to do some numerical work to compare with this to be sure. – KBriggs Jan 31 '17 at 18:40