Friday, May 14, 2010

Analysing acceleration sensor data with wavelets

Before we get back to Android programming, we need some theoretical background on signal analysis.The document is somewhat heavy on math. To quote Dr. Kaufman's Fortran Coloring Book: if you don't like it, skip it. But if your teacher likes it, you failed.

Click here to read the report.

If you are too impatient to read, here is the essence.

There is no single perfect algorithm when analysing acceleration signals. The analysis framework should provide a toolbox of different algorithms, some working in the time-domain, some operating in the frequency domain. The decision engine that classifies the movements may use a number of algorithms, a characteristic set for each movement type.

It has been concluded in the medical research community that wavelet transformation is the most optimal algorithm for frequency-domain analysis of acceleration signals. This report presented concrete cases, how wavelet transformation can be used to classify three common movements: walking, running and shake. In addition, the wavelet transformation provided data series that can be used to extract other interesting information, e.g. step count.

For those who would like to repeat my experiments, I uploaded the prototype. First
you need Sage (I used version 4.3.3). Download and unpack the prototype package and enter the proto directory. Then launch Sage (with the "sage" command) and issue the following commands:

import accel
accel.movements(5)

now you will be able to look at the different waveforms, e.g.

list_plot(accel.shake_w5)

Sage is scriptable in Python. If you know Python, you will find everything familiar, if not - bad luck, you won't get far in Sage.

6 comments:

Asher's Elephant said...
This comment has been removed by the author.
Jordan said...

Hi Gabor,

Cool stuff! For my PhD work, I'm looking at some alternative methods for classifying time series data. I think that you might find them interesting. It's a very different approach from the standard signal processing techniques, and draws from the nonlinear dynamical systems literature.

I think I can make a fairly good argument that a phone in one's pocket is observing the accelerations from a nonlinear dynamical system (i.e., the human body), and so I've found that some techniques for reconstructing dynamical systems from observations (embeddings) have worked really well for classifying activities such as running, walking, and many different exercises.

We also found that the technique is sensitive enough to tell the difference between people based on their gait, or style of walking. We have an experiment with 40 people and we can identify each individual with 100% accuracy. Pretty cool stuff indeed. Those results will be published in the AAAI 2010 conference in a couple of months (www.aaai.org). Once the paper is published, I'd be happy to share more info about that. I'd love to see if any of these traditional signal processing approaches like wavelets can match that accuracy, but haven't had time to implement them myself.

Anyway, I'd love to find out why you're looking into this subject. Making an app? Academic interest?

Gabor Paller said...

Hi, Jordan,

My interest is purely academic but I happen to know some people who look at it from the business angle. My E-mail is gaborpaller@gmail.com

Gabor Paller said...

Hi, Jordan. My interest is purely academic but I happen to know some people who look at it from the business angle. My e-mail if interested: gaborpaller@gmail.com

c programming said...

Good Work. Keep it up. It helps a lot.

jor said...

Hi Gabor,

could you post the link to the mentioned paper one more? it's broken, so it seems...

thanks alot, like your blog!