net.sf.jaer.util.filter
Class AngularLowpassFilter
java.lang.Object
net.sf.jaer.util.filter.Filter
net.sf.jaer.util.filter.LowpassFilter
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AngularLowpassFilter
public AngularLowpassFilter(float period)
- Creates a new instance of AngularLowpassFilter
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 valuetime
- 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