I am trying to detect if a car did accelerate or did brake by using the accelerometer of the iPhone.
In the figure below I plotted the collected data. (To collect the data the phone was laying flat in the car facing the top of the phone to the front).
The issue I am having now is that visually I can clearly see where the car accelerated and where it did brake (see below). But can't figure out how to do that programatically.
What I basically want is to know how often a car did brake or accelerate during a certain time window. (Window size around 10-30 seconds).
Any help would be highly appreciated.
Thanks in advance!