Package lejos.robotics.filter
Class MeanFilter
- java.lang.Object
-
- lejos.robotics.filter.AbstractFilter
-
- lejos.robotics.filter.SumFilter
-
- lejos.robotics.filter.MeanFilter
-
- All Implemented Interfaces:
SampleProvider
public class MeanFilter extends SumFilter
This filter returns the mean values found in the N most recent samples.
The number of samples used is specified in the constructor of the filter.- Author:
- Aswin
-
-
Field Summary
-
Fields inherited from class lejos.robotics.filter.AbstractFilter
sampleSize, source
-
-
Constructor Summary
Constructors Constructor Description MeanFilter(SampleProvider source, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchSample(float[] sample, int off)Fetches a sample from a sensor or filter.-
Methods inherited from class lejos.robotics.filter.SumFilter
getActualSize
-
Methods inherited from class lejos.robotics.filter.AbstractFilter
sampleSize
-
-
-
-
Constructor Detail
-
MeanFilter
public MeanFilter(SampleProvider source, int length)
-
-
Method Detail
-
fetchSample
public void fetchSample(float[] sample, int off)Description copied from interface:SampleProviderFetches a sample from a sensor or filter.- Specified by:
fetchSamplein interfaceSampleProvider- Overrides:
fetchSamplein classSumFilter- Parameters:
sample- The array to store the sample in.off- The elements of the sample are stored in the array starting at the offset position.
-
-