Accelerometer sensor's data analysis Here is a sample data that I got from the accelerometer sensor:

The first selected area shows the acceleration of the IMU device to right side and the second shows the movement to left side.
I am looking for an algorithm to detect selected areas (as an array of floats) and provide the direction.
I almost don't know anything in this area (signal processing), So I tried to avoid using incorrect keywords, feel free to edit this post.
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;.