|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.drismo.logic.AccelerationHandler.MAQueue
private static final class AccelerationHandler.MAQueue
An inner static class used to remove noise from the acceleration values. Keeps a simple FIFO queue of N acceleration values, used to filter out noise using the Weighted/Exponential Moving Average algorithm.
Field Summary | |
---|---|
private java.util.LinkedList<float[]> |
list
The queue of vectors. |
private int |
N
N elements in the queue. |
Constructor Summary | |
---|---|
private |
AccelerationHandler.MAQueue()
|
Method Summary | |
---|---|
private float[] |
getEMAValues()
Calculates the EMA value of the element i in the queue, based on the Exponential Moving Average algorithm. |
float[] |
getWMAValues()
Calculates the WMA value of the element i in the queue, based on the Weighted Moving Average algorithm. |
void |
put(float[] v)
Puts the acceleration vector in the FIFO queue, and removes excessive vectors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int N
private java.util.LinkedList<float[]> list
Constructor Detail |
---|
private AccelerationHandler.MAQueue()
Method Detail |
---|
public void put(float[] v)
v
- The XYZ acceleration vectors.public float[] getWMAValues()
private float[] getEMAValues()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |