Accelerometer sensor's data analysis
First, learn about digital differentiators and how to implement them with software. Then apply your accelerometer output signal to a digital differentiator. Next, use software to detect a large positive-valued sample followed by a large negative-valued sample in the differentiator's output sequence. That sample will correspond to your &quot;first selected area&quot;. Finally, use software to detect a large negative-valued sample followed by a large positive-valued sample in the differentiator's output sequence. That sample will correspond to your &quot;second selected area&quot;.