I have a piecewise constant signal shown below. I want to detect the location of step transition (Marked in red).
My current approach:
- Smooth signal using moving average filter (http://www.mathworks.com/help/signal/examples/signal-smoothing.html)
- Perform Discrete Wavelet transform to get discontinuities
- Locate the discontinuities to get the location of step transition
I am currently implementing the last step of detecting the discontinuities. However, I cannot get the precise location and end with many false detection.
My question:
- Is this the correct approach?
- If yes, can someone shed some info/ algorithm to use for the last step?
- Please suggest an alternate/ better approach.
Thanks