I am trying to figure out an easy way how to distinguish the highlighted areas in red in the drawing below from the other areas.
Other areas mean those high spikes but also areas on the same level which have higher fluctuations.
I thought about going from left to right and calculating the std. deviation for the last 100 samples or so but I have a hard time figuring out a border which determines "sample is in valid range" or "high fluctuation area".
I also tried kmeans algorithm but either I didn't use it right or it is not suited for this job.
I mean it is easy for us humans to see what is the difference between the highlighted areas and the other ones but I don't know how to do this programmatically.