I have access to the step response of a system and I want to find its poles and zeros without knowing the order of the system.

Consider an example of a step response of the system shown in the figure below. Here is the link to the raw data if someone wants to try it (https://pastebin.com/BpT4d9RW).

enter image description here

I want to build an IIR filter (with arbitrary number of poles and zeros) that has the same step response (or pretty close to it).

I have tried using the prny() function in MATLAB for that purpose, and the closest result I could get was the following. I am actually not sure what I am doing wrong here and if there are any considerations for using the prony() function that I am not aware of.

I would appreciate if someone can help me on correct use of the function OR can come up with some other approach that works.

enter image description here

Please also note that the approach should be general enough to accommodate any type of step responses (over-damped or under-damped).

  • $\begingroup$ Apart from the scaling the step response doesn't look bad at all. What don't you like about it? $\endgroup$ – Matt L. Jul 20 '18 at 8:25
  • $\begingroup$ The DC levels are different, and if I shift the DC level the peaking would be different. If I start with a step response of an analytical transfer function, I can get exactly the same step response. However in this case of simulated step response I don't know why there is DC offset and peak mismatch. This has probably something to do with the delay, cause it matters at which point you trim the the step (or impulse) response, and I am not sure why is that. $\endgroup$ – shampar Jul 20 '18 at 14:03
  • $\begingroup$ You could post the code how exactly you compute the step response. I think it should be straightforward to solve the problem, but I might be wrong. $\endgroup$ – Matt L. Jul 20 '18 at 14:41
  • $\begingroup$ I have uploaded three files in here, (one MATLAB .m file and two .csv files which contain the step responses): files.fm/u/ghw8pjj8. Let me know if there is any trouble in accessing the file. $\endgroup$ – shampar Jul 23 '18 at 21:26
  • $\begingroup$ Or alternatively, you can create these three files yourself from the text and data that I pasted in the following link: pastebin.com/Wx08qyTz $\endgroup$ – shampar Jul 23 '18 at 21:38

There are two problems here that need to be solved. The first is the delay of the measured step response, i.e. how many samples from the beginning you need to discard. This is critical in your example because you chose a second-order system to model the data, and such a system is not very flexible in adding or subtracting delay. Delay could be added by adding more zeros to the system, i.e. by increasing the order of the numerator. If you don't want that then you will need to optimize the delay of the step response such that it can be optimally approximated by a second-order system.

The other problem is the fact that the designed filter doesn't reach the final value of the measured step response. The reason is that the impulse response required by Prony's method is derived by computing the difference of adjacent step response samples without taking into account that the step response was truncated. Since several samples of the measured step response are discarded, you also discard the same number of samples of the impulse response, and if you were to compute a step response from that truncated impulse response (by computing the cumulative sum), you would get a step response that is different from the measured one (and that would be close to the one implemented by the designed filter). The solution to this problem is very straightforward. Just truncate the step response and add a value of zero at the beginning. Then compute the corresponding impulse response by taking differences, and the first value of the impulse response will equal the first (non-zero) value of the step response, i.e., it will represent the accumulated past of the original impulse response (before truncation).

I did that and found as optimal starting value for the step response an index of $530$ for a filter order of $2$. The figure below shows that the step response of the designed filter closely approximates the measured step response:

enter image description here

  • $\begingroup$ Thank you Matt. That is exactly what I came up with as the solution. I had noticed adding a 0 to the SR before taking the diff would make the results better. Also, as I mentioned before, by sweeping over the starting point and order of the filter I could come up with a pretty good solution. Anyway, thanks for the extra clarification of the problem. I am wondering if by knowing the order of the filter is there any analytical approach to find the delay (i.e. the best staring point of the step response)? $\endgroup$ – shampar Jul 30 '18 at 22:05
  • $\begingroup$ I don't think there's much you can do analytically. You have the same problem when designing filters with non-linear phase where you can add a linear phase term (a delay) for minimizing the overall approximation error. The value of that delay has also to be found via a simple search. $\endgroup$ – Matt L. Aug 1 '18 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.