Question

I am working on accelerometer from an android phone. I wish to filter the horrible noise the accelerometer is returning recording the phone's moves.

I was reading around on Kalman filter, because low pass are just not enough.

But I don't have a model of the transition from ACCELERATION(k-1) to ACCELERATION(k) because it is the movements of the user. So I have no state transition matrix (H or F in different papers, the one that multiply Xk-1 in the equation Xk = HXk-1 + Bcommand+noise)

I saw some people taking the identity matrix in simple examples. How can it work for dynamic acceleration?

I know Kalman Filters, people always produce some H matrix, I just don't know how in my case.

Was it helpful?

Solution

Kalman Filter is often thought of as a linear filter where you have all model matrices but the idea of filter and its first applications come from non-linear models. In that case you use functions instead of matrices.

If the functions for prediction and update are highly non-linear you can use statistical methods to estimate your parameters on-line. The first look what you can take is unscented kalman filter which recovers mean and covariance from deterministic sampling technique - unscented transformation. I think in your case this could be the best to start with.

There are other variants of Kalman Filter. You can start from wikipedia but if you google "adaptive kalman filter" you can see the variety of the subject.

If you want to get deeper into the subject but not necessary start with all maths I recommend very good book: Kalman Filter for Beginners to start with by Phil Kim . There are also other possibility as sensor fusion, but it is another broad subject.

OTHER TIPS

You can use the identity matrix.

The state transition matrix is used to predict the future state based on current state, in the absence of any new measurements. In your case, as you say, you do not have any way of predicting future state (acceleration) - so your best guess is that future state (acceleration) is the same as current state. This is exactly what identity matrix does.

In many Kalman filters, there is some way of predicting the future state based on current state, and that's where a non-identity state transition matrix would step in. For example, suppose your Kalman filter estimates vehicle position and speed based on GPS and speedometer; then you could predict future position by changing position based on speed, even without new measurements. Dave's answer shows how to do it using state transition matrix.

Given a state vector [x, v_x, a_x], i.e. the position, speed and acceleration of the object in one direction (the same logic applies for the other two degrees of freedom). You usually define the state transition matrix as

1   dt   0.5*dt*dt
0   1    dt
0   0    1

If you write this out you get:

xnew = x+v_x*dt + 0.5*a_x*dt*dt
vnew = v_x + a_x*dt
anew = a_x

These are the equations of motion for an object moving with a constant acceleration.

The way that the unknown user caused motions are handled in the Kalman framework is through the plant noise term. You assume that, instead of continuing on with the exact same acceleration, there are unknown random perturbations to acceleration (and thus to the other components of the state).

The thing with kalman filter is that it does prediction and then corrects your prediction based on your observation. If your model is not very dynamic although your model assumes constant position but based on your observation you will get something in between.So Identity could work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top