views:

29

answers:

1

Before I reinvent the wheel I wanted to see if anyone can share code or tips for the following:

In order to get relative position of the iPhone, one needs to

  • Set the accelerometer read rate
  • Noise filter the accelerometer response
  • Convert it to a vector
  • Low pass filter the vector to find gravity
  • Subtract gravity from the raw reading to find the user caused acceleration
  • Filter the user caused acceleration to get the frequencies you are interested in ( probably bandpass depending on the application)
  • Integrate to find relative speed
  • Integrate to find position

So what I'm hoping is that people have already written some or all of the above and can provide tips, or better yet code.

A few questions I haven't found the answer to:

What is the frequency response of the iPhone accelerometer? What hardware filters exist between the accelerometer and the analog to digital converter?

What is the fastest reading rate the accelerometer delegate can be called without duplicating reading values?

Differences in the above for the various phones?

Any good tips for designing the filters, such as cutoff frequency for separating gravity and user motion?

Any code or tips for the integration steps? Any reason to integrate in the cartesion coordinate system rather than as vector, or vise versa?

Any other experiences, tips, or information that one should know prior to implementing this?

+1  A: 
Adam Davis