I have a vector A (see example attached) corresponding to voltage from a strain gauge while testing strength levels in humans, at varying (random) times. I need to calculate a mean value of all "clean" baseline periods in the vector (i.e. no change in voltage greater than the own signal standard deviation). However, there may be random periods where baseline is "noised" due to movement. I want to automatically avoid these periods in the mean baseline calculation.