Interface AFilter
- All Known Implementing Classes:
AFilterGroup
,AHighPassFilter
,ALowPassFilter
,AMotionProfile
,ARateLimit
public interface AFilter
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 AFilter
Combine two AFilters by adding their results togetherstatic AFilter
Create an AFilter from a list of AFilters.Get next value in Filter based on the next value givendefault AFilter
invert()
Invert an AFilter by subtracting the input from the result of the AFilter.default AFilter
Combine two AFilters by subtracting their results togetherdefault AFilter
Combine an AFilter with another AFilter
-
Method Details
-
create
Create an AFilter from a list of AFilters. This will create an AFilter with the least possible overhead for the number of filters provided.- Parameters:
filters
- list of AFilters to apply- Returns:
- an AFilter that uses every filter given
-
get
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 AFilter with another AFilter- Parameters:
next
- filter to be evaluated after this one- Returns:
- the combined filter
-
add
Combine two AFilters by adding their results together- Parameters:
other
- other AFilter to add to this one- Returns:
- the resulting AFilter after the sum
-
sub
Combine two AFilters by subtracting their results together- Parameters:
other
- other AFilter to subtract from this one- Returns:
- the resulting AFilter after the subtraction
-
invert
Invert an AFilter by subtracting the input from the result of the AFilter.Inverting a LowPassFilter gives you a HighPassFilter and vise versa.
Inverting something twice gives you the original value.
- Returns:
- the inverted filter
-