public class OffsetCorrectionFilter extends AbstractFilter
sampleSize, source
Constructor and Description |
---|
OffsetCorrectionFilter(SampleProvider source)
Constructor for the offset correction filter using default parameters.
|
OffsetCorrectionFilter(SampleProvider source,
float[] reference)
Constructor for the offset correction filter using default window of 200
samples.
|
OffsetCorrectionFilter(SampleProvider source,
float[] reference,
int bufferSize)
Constructor for the offset correction filter.
Constructor |
Modifier and Type | Method and Description |
---|---|
void |
fetchSample(float[] sample,
int offset)
Fetches a sample from a sensor or filter.
|
float[] |
getMean()
Returns the mean sample value
|
float[] |
getStandardDeviation()
Returns the standard deviation from the mean sample value
|
void |
reset()
Resets the filter
|
sampleSize
public OffsetCorrectionFilter(SampleProvider source)
source
- source for samplepublic OffsetCorrectionFilter(SampleProvider source, float[] reference)
source
- source for samplereference
- An array with reference values. The array length should match the
sample size.public OffsetCorrectionFilter(SampleProvider source, float[] reference, int bufferSize)
source
- Source for samplereference
- An array with reference values. The array length should match the
sample size.bufferSize
- Number of samples to use for calculating offset errorpublic void fetchSample(float[] sample, int offset)
SampleProvider
fetchSample
in interface SampleProvider
fetchSample
in class AbstractFilter
sample
- The array to store the sample in.offset
- The elements of the sample are stored in the array starting at the offset position.public void reset()
public float[] getMean()
public float[] getStandardDeviation()