Android Low Filter Accelerometer

I want to use the accelerometer in android for my application. In the documentation below:

final float alpha = 0.8; // Isolate the force of gravity with the low-pass filter. gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0]; 

But the low-pass filter works as follows:

  output = alpha*input + (1-alpha)*previousoutput; 

My query is why we perceive gravity as an input and sensory event as the previous result? It should be the other way around.

+4
source share
1 answer

Technically, it uses a linear combination of two inputs: mix(α,x,y) = α * x + (1-α) * y .

Now mix(α,x,y) equivalent to mix(1-α,y,x) . Thus, you can cancel the signals as you like, make alpha = 0.2 , and everything will work the same.

0
source

Source: https://habr.com/ru/post/1438660/


All Articles