# FIR filter reverse engineering from step response

I am working on a reverse engineering problem - I am trying to reconstruct a filter.

I have:

1. The step response of the system. (I could calculate the impulse response by derivating)

I know:

1. The system consists of a low-pass FIR and a decimation unit (decimation by 4, probably).
2. In the step response, there is always a point in the middle of the step amplitude (the attached image)
3. The group delay of the entire system is around 68.

1. The impulse response should be symmetrical - for all obtained impulse responses (I have acquired several step responses) there are two points with similar amplitude - apart from those two points the impulse response is symmetrical.
2. According to the manufacturer, the filter should have 5% skirt and 104 dB attenuation.

My main task is to repeat the behaviour of the system - convolving new signals with the obtained impulse response works - still - I would like to have a model of my filter.

I would like to synthesise a filter (FIR), which similar characteristics - with group delay around 68. (the filter should have more than decimation*68*2 taps)

I cannot obtain a filter which would guarantee this middle point. Could you recommend me a tool/approach? (currently, I'm using the MATLAB filter design tool)

EDIT. I would like to generate several filters and select the best filter. (more Bayesian approach)

The relation of the discrete-time step response, $s[n]$, and discrete-time impulse response, $h[n]$, is

$$s[n] = \sum\limits^{n}_{m=-\infty} h[m]$$

and

$$h[n] = s[n] - s[n-1]$$

from $h[n]$ you can compute the DFT (of a large finite segment of $h[n]$) and get the frequency response of this filter:

$$H(e^{j \omega}) = \sum\limits_{n=-N/2}^{N/2-1} h[n] e^{-j \omega n}$$

remember, with a finite delay allowed for the filter (this is your 68 samples), you can model both your impulse response $h[n]$ and step response $s[n]$ as symmetric about $n=0$ and define the origin for $n$ there at the 68th sample. doesn't matter if that makes the filter acausal. don't sweat that.

also, keep in mind that the operation that turns the step response into the impulse response is a discrete-time differentiator, which means the information about DC is lost. the DC component in your impulse response that is derived from your step response is the step size of the step response, $s[+68]-s[-68]$. you can add to both any constant and that will not change the impulse response $h[n]$ at all.

oh, and expect 2×68 + 1 taps.

• Thank you so much. I will have a look. On the other hand I was trying to avoid going for an odd filter because the group delay will not be exactly 68 but 68.5. – mikel Nov 3 '17 at 6:22
• no, @mikel, that's precisely wrong. you need your filter length to be odd so that your filter delay is an integer number of samples and not halfway in between. – robert bristow-johnson Nov 3 '17 at 19:00