Interface IFilter
- All Known Implementing Classes:
Derivative
,HighPassFilter
,IFilterGroup
,LowPassFilter
,MotionProfile
,RateLimit
,TimedMovingAverage
public interface IFilter
This is the Filter interface class that gives a definition for how to implement a filter.
All that a filter does is take in the next double in a series and gives you the filtered value.
-
Method Summary
Modifier and TypeMethodDescriptiondefault IFilter
Combine two IFilters by adding their results togetherstatic IFilter
Create an IFilter from a list of IFilters.double
get
(double next) Get next value in Filter based on the next value givendefault IFilter
invert()
Invert an IFilter by subtracting the input from the result of the IFilter.default IFilter
Combine two IFilters by subtracting their results togetherdefault IFilter
Combine an IFilter with another IFilter
-
Method Details
-
create
Create an IFilter from a list of IFilters. This will create an IFilter with the least possible overhead for the number of filters provided.- Parameters:
filters
- list of IFilters to apply- Returns:
- an IFilter that uses every filter given
-
get
double get(double next) Get next value in Filter based on the next value given- Parameters:
next
- next input value in the stream- Returns:
- the output value of the filter
-
then
Combine an IFilter with another IFilter- Parameters:
next
- filter to be evaluated after this one- Returns:
- the combined filter
-
add
Combine two IFilters by adding their results together- Parameters:
other
- other IFilter to add to this one- Returns:
- the resulting IFilter after the sum
-
sub
Combine two IFilters by subtracting their results together- Parameters:
other
- other IFilter to subtract from this one- Returns:
- the resulting IFilter after the subtraction
-
invert
Invert an IFilter by subtracting the input from the result of the IFilter.Inverting a LowPassFilter gives you a HighPassFilter and vise versa.
Inverting something twice gives you the original value.
- Returns:
- the inverted filter
-