I have data samples for an EMG signal of three arm reps. In the data I have 1 signal that is flat then fluctuates in voltage then becomes flat again shows three pulses for each rep. I want to separate the three reps from the signal (chop the signal into 3 parts). I can manually do this by plotting the signal then zooming in and finding the index before the variance in voltage fluctuates and after it flat lines again. I wanted to know if there is an automated way to do this. Some sort of greedy algorithm or a built in Matlab function. Any ideas?
So I would want:
1 [-40,-45,80,85] 2 [-100,-105,80,85] 3 [-200,-45,305,85]
Usually the flat line values vary from zero.