Package lejos.robotics.filter
Class LowPassFilter
- java.lang.Object
-
- lejos.robotics.filter.AbstractFilter
-
- lejos.robotics.filter.LowPassFilter
-
- All Implemented Interfaces:
SampleProvider
public class LowPassFilter extends AbstractFilter
Provides a low-pass filter for samples- Author:
- Aswin
- See Also:
- http://en.wikipedia. org/wiki/Low-pass_filter
-
-
Field Summary
-
Fields inherited from class lejos.robotics.filter.AbstractFilter
sampleSize, source
-
-
Constructor Summary
Constructors Constructor Description LowPassFilter(SampleProvider source, float timeConstant)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchSample(float[] dst, int off)Fetches a sample from the source and low-passes it See http://en.wikipedia.org/wiki/Low-pass_filtervoidsetTimeConstant(float timeConstant)-
Methods inherited from class lejos.robotics.filter.AbstractFilter
sampleSize
-
-
-
-
Constructor Detail
-
LowPassFilter
public LowPassFilter(SampleProvider source, float timeConstant)
Constructor- Parameters:
source- The source for getting samplestimeConstant- The cut-off frequency for the filter
-
-
Method Detail
-
fetchSample
public void fetchSample(float[] dst, int off)Fetches a sample from the source and low-passes it See http://en.wikipedia.org/wiki/Low-pass_filter- Specified by:
fetchSamplein interfaceSampleProvider- Overrides:
fetchSamplein classAbstractFilter- Parameters:
dst- The array to store the sample in.off- The elements of the sample are stored in the array starting at the offset position.
-
setTimeConstant
public void setTimeConstant(float timeConstant)
-
-