I have a (noisy) square wave signal and need to extract the data points that make up the 'baseline' and 'plateau' ONLY. I do not want data from the rise and fall. So far I have accomplished the following:
data points designated as 'baseline' or 'plateau' superimposed onto original signal
I have defined 'baseline' data points as those from the minimum to the mean of the lowest 25% of signals + 1 standard deviation of the lowest 25% of signals.
Similarly I have defined 'plateau' data points as those from the maximum to the mean of the highest 25% of signals - 1 standard deviation of the highest 25% of signals.
This works ok, but as you can see: sometimes 1 standard deviation is not enough to encapsulate all of the baseline noise. 2 Standard deviations often encapsulate too much of the rise/fall of the signal.
Can anyone provide a more elegant solution to this?
My aim is to measure the signal to noise ratio of the square pulse, so I need to extract the populations that will give me baseline noise and the mean pulse height.