org.wiigee.filter
Class Filter

java.lang.Object
  extended by org.wiigee.filter.Filter
Direct Known Subclasses:
DirectionalEquivalenceFilter, HighPassFilter, IdleStateFilter, LowPassFilter, MotionDetectFilter

public abstract class Filter
extends java.lang.Object

Abstract class to give a definition for a general filter.


Constructor Summary
Filter()
           
 
Method Summary
 double[] filter(double[] vector)
          The actual called method to filter anything.
abstract  double[] filterAlgorithm(double[] vector)
          A filter receives a triple of acceleration values within the variable 'vector'.
abstract  void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter()
Method Detail

filter

public double[] filter(double[] vector)
The actual called method to filter anything. It checks if the vector is already set to NULL by another filter and won't process it anymore. If it's not NULL it would be forwarded to the actual implemented method - filterAlgorithm().

Parameters:
vector - The acceleration vector, encoding: 0/x, 1/y, 2/z
Returns:
a new, filtered acceleration vector, encoded the same way

filterAlgorithm

public abstract double[] filterAlgorithm(double[] vector)
A filter receives a triple of acceleration values within the variable 'vector'. It's encoded as vector[0]=x, vector[1]=y, vector[2]=z. This is not an object since the processing of the filter should be really fast, since every acceleration of the wiimote passes the filter.

Parameters:
vector -
absvalue -
Returns:

reset

public abstract void reset()