public final class WindowedMean
extends java.lang.Object
| Constructor and Description |
|---|
WindowedMean(int window_size)
constructor, window_size specifies the number of samples we will continuously get the mean and variance from. the class will
only return meaning full values if at least window_size values have been added.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(float value)
adds a new sample to this mean. in case the window is full the oldest value will be replaced by this new value.
|
void |
clear()
clears this WindowedMean.
|
float |
getLatest() |
float |
getMean()
returns the mean of the samples added to this instance. only returns meaningfull results when at least window_size samples
as specified in the constructor have been added.
|
float |
getOldest() |
boolean |
hasEnoughData() |
float |
standardDeviation() |
public WindowedMean(int window_size)
window_size - size of the sample windowpublic boolean hasEnoughData()
public void clear()
public void addValue(float value)
value - The value to addpublic float getMean()
public float getOldest()
public float getLatest()
public float standardDeviation()