public class AveragingFilter
extends java.lang.Object
Constructor and Description |
---|
AveragingFilter(int length,
double init_val)
Initialize all things needed for the averaging filter.
|
Modifier and Type | Method and Description |
---|---|
double |
filter(double input)
Add a new input to the filter and get the current output from the filter
|
void |
reset() |
public AveragingFilter(int length, double init_val)
length
- The number of previous points to consider in the averaged output. Larger values
will reduce noise more aggressively, but also induce more delay in the signal.init_val
- The initial value the filter should output. Usually zero, but might be
something else if you know more about your system than we do.