I have the need to detect two different gestures that occur when looking at accelerometer data. Here's a run down (as brief as I can make it):
Lets say an iPhone is being oscillated back and forth while remaining face-up. The user can either do one oscillation (once forward or backward, gesture one) or a continuous oscillation for any amount of time (gesture two).
Currently my code maintains a list of the device's accelerometer data (y-axis) from the last 50 frames . Each frame this data is put through an FFT algorithm (this one http://goo.gl/yi3mn), and then I try to interpret the frequency domain given. I have noticed a strong relationship between the speed of the oscillations, and the power of the mid to low range of the frequency space.
The problem is that I need to detect (in real-time as the movement animates something on screen) whether the just finished oscillation is a singular one, or one that continues into another oscillation in the opposite direction. Here I should point out that accelerometers work with pressure plates. When an oscillation stops the input data will show the opposite value from when the oscillation was being performed. This makes it difficult to see any obvious difference between a single forwards movement and a double forwards then backwards movement (at the end of the each first oscillation).
Can anyone suggest how I might make use of an FFT to decipher an accurate magnitude value (or something else useful) that I can use to tell the difference between the gestures described above?
I have recorded the data I am using to text files. It is the raw data (g-force values) along the y-axis of the accelerometer input.
http://pastebin.ca/2108123 shows data for 2 singular oscillations (I hold the device still at the start, end, and between the two oscillations).
NOTE: new raw data with 20 oscillations has been uploaded, but not yet plotted. http://pastebin.ca/2108387 shows data for 20 continuous oscillations (I hold the device still at the start and end).