Signal segmentation into states ( Stop/mov) My question concerns signal segmentation.
My signal is the green one, which represents the distance from the first point to the rest of points.
I would like to cut the  trajectory into segments that each represents  the current status of the person, is he currently making a move, or making a stop?
This is my plot:


the green line is the distance measures smoothed using savitzky golay.
The second line in red represents the results I would like to have, when its =1 its a move, and when it is equal to 0 it is a stop in reality.As you can see, it is somehow easy to segment the trajectory using the trends, when it is increasing or decreasing, we should have a move. When it is constant, we should have a stop.

My question is, what are the methods that I can use and that can segment a signal using the trend change ?
Thank you
It seems like you already got all the right components. Your goal is to detect segments where speed!=0 in the data. Since speed is the derivative of position, you could transform the data into the first difference series - simply subtract the preceding point from each data point, i.e. $x_t - x_{t-1}$, and you'll have a crude estimate of the derivative.
The series of differences then can be segmented with any standard method for peak or changepoint detection. In particular, since you know the background value (zero), and the speed appears roughly constant during each movement episode, it seems that epidemic detection of changes in mean should be able to solve this nicely. I am aware of a couple packages for this in R, but it's also relatively easy to implement it yourself if it's not available for your programming language (just search for &quot;epidemic changepoint detection&quot;). Multivariate detectors in the same framework are also available, if you were interested in incorporating several sensors to detect movement, for example.