I used the CUSUM algorithm to detect steps in data. Basically the data looks like this, the data has a constant amplitude and then there is a rapid variation or a step. For example, the signal has a value of 1000 and rapidly drops to 950 or 900. With the CUSUM algorithm, I can detect easily these changes and the time at which they occur. But now I would also like to automate the amplitude estimations of these steps. Eventually, I'll need to implement this in real-time ( a small delay is tolerable for the amplitude estimation)
One solution I would like to try is this one :
- take N samples before the step and take N samples after the step and subtract the respective averages.
Is there a better solution?
Edit : - The transition from 1000 to 900, for example, might take 10 samples in all.