4
$\begingroup$

Apologies from the start if my terminology is inaccurate, but what I have is a series of measurements that are made over a short time period from a hardware device to which I have just supplied a stimulus.

The measurements fairly quickly settle around some small range of values, but what I want to do is to stop measuring when I've received enough data points to detect the settling. If you take a look at the following plots, it might be easier to see what I'm trying to say.

The measurements may be increasing or decreasing from the initial point, and may be relatively free of noise, like these:

increasing

decreasing

Or, they may be quite noisy, like these:

noisyincrease

noisydecrease

As you can see, the range of values on the y-axis may differ by an order of magnitude or so.

I don't need to have very high accuracy, but I do need to stop measuring as soon as possible because the elapsed time for taking measurements is high and I'm trying to minimise it.

So, what techniques can I use to identify the "corner" point as it arrives? I can see that it might be easier to identify it from a complete sequence like those shown above, but how can I get a good estimate of when to stop measuring?

I hope I've made that clear - please comment if you need any more information and I'll do my best to clarify the question. Also, please re-tag as you see fit - having no idea what to search for, I also have no idea what to tag it with!

$\endgroup$
3
$\begingroup$

The simplest approach would be to estimate the current value of the derivative, and stop once its absolute value is low. To account for noise, you'll want to take the average derivative over some time window. For example, you could stop when $$ D(t) = \left|\frac{1}{N}\sum_{i=t-N+1}^{t}(f(i)-f(i-1))\right| < \theta $$ or equivalently $$ D(t) = \frac{1}{N}\left|f(t)-f(t-N)\right| < \theta $$ where $N$ and $\theta$ will need to be tuned depending on the noise level and what speed/accuracy tradeoff you want.

$\endgroup$
  • $\begingroup$ Thanks Chris, that's very helpful. +1. I'm not sure I quite understand that second equation though - this is just scaling theta by the stdev isn't it? So that's the stdev of the samples so far or are you assuming the whole population? $\endgroup$ – Roger Rowland Apr 13 '15 at 18:49
  • 1
    $\begingroup$ After thinking about it further, I've removed the second equation. The goal was to estimate the noise level during the current window and see if the derivative was high relative to that noise, but I'm unsure if that would actually work - it might mistakenly trigger too early, since the variance will be very high at the beginning. $\endgroup$ – Chris Apr 13 '15 at 21:38

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.