Best way to detect steps and slopes in a signal what is the best way of detecting larger steps and slopes in a signal?
(as shown in the pictures, 1. to be detected signal, 2. good signal)
I thought about some kind of sliding window analysis.
Thanks for help.
This problem is heavily related to the notion of piece-wise constant or piece-wise linear approximations. Either to fit the experimental curve at best, or to find the optimal parameters may requires some more details, like: do you know the number of parts? Any idea about the noise? Some literature to start with:


Best piecewise constant approximation of a function of single variable
Models and Algorithms for Optimal Piecewise-Linear Function Approximation
Fitting Piecewise Linear Continuous Functions