jAER project on SourceForge

net.sf.jaer.util.filter
Class AngularLowpassFilter

java.lang.Object
  extended by net.sf.jaer.util.filter.Filter
      extended by net.sf.jaer.util.filter.LowpassFilter
          extended by net.sf.jaer.util.filter.AngularLowpassFilter

public class AngularLowpassFilter
extends LowpassFilter

A lowpass filter that correctly handles a circular variable like an angle. Values crossing the cut do not have undue influence. The filter has a period (like 2Pi) and the cut is assumed to be at 0/period. For example, a present value of 350 deg and an input of 10 deg will push the filter by an angle of 20 degrees towards zero, instead of by -340 deg.

Author:
tobi

Field Summary
 
Fields inherited from class net.sf.jaer.util.filter.LowpassFilter
lastVal, lpVal
 
Fields inherited from class net.sf.jaer.util.filter.Filter
initialized, lastTime, tauMs, TICK_PER_MS
 
Constructor Summary
AngularLowpassFilter(float period)
          Creates a new instance of AngularLowpassFilter
 
Method Summary
 float filter(float val, int time)
          Overrides super to handle cut.
 float getPeriod()
           
 void setPeriod(float period)
          Sets the circular period
 
Methods inherited from class net.sf.jaer.util.filter.LowpassFilter
getValue, setInternalValue, toString
 
Methods inherited from class net.sf.jaer.util.filter.Filter
get3dBFreqHz, getLastTime, getTauMs, set3dBFreqHz, setTauMs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AngularLowpassFilter

public AngularLowpassFilter(float period)
Creates a new instance of AngularLowpassFilter

Method Detail

filter

public float filter(float val,
                    int time)
Overrides super to handle cut. If the absolute distance between the sample "value" and the internal value is shorter crossing the cut, then the

Overrides:
filter in class LowpassFilter
Parameters:
val - the new input value
time - the time in us - note units here, microseconds!
Returns:
the new filter output value

getPeriod

public float getPeriod()

setPeriod

public void setPeriod(float period)
Sets the circular period

Parameters:
period - the period, e.g. 2*Math.PI or 360

jAER project on SourceForge