Package trclib.dataprocessor
Class TrcIIRFilter
java.lang.Object
trclib.dataprocessor.TrcFilter
trclib.dataprocessor.TrcIIRFilter
This class implements the Infinite Impulse Response filter. It is useful for filtering noise from the sensor data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double
private double
private final double
Fields inherited from class trclib.dataprocessor.TrcFilter
instanceName, tracer
-
Constructor Summary
ConstructorsConstructorDescriptionTrcIIRFilter
(String instanceName) Constructor: Create an instance of the object.TrcIIRFilter
(String instanceName, double weight) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
filterData
(double data) This method returns the filtered data.void
reset()
This method resets the filter.
-
Field Details
-
DEF_WEIGHT
private static final double DEF_WEIGHT- See Also:
-
weight
private final double weight -
filteredData
private double filteredData
-
-
Constructor Details
-
TrcIIRFilter
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.weight
- specifies the weight of the current data point.
-
TrcIIRFilter
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.
-
-
Method Details
-
reset
public void reset()This method resets the filter. -
filterData
public double filterData(double data) This method returns the filtered data.- Specified by:
filterData
in classTrcFilter
- Parameters:
data
- specifies the data value to be filtered.- Returns:
- filtered data.
-