Class CentralMovingAverageFilter
Represents a simple central moving average filter.
public class CentralMovingAverageFilter : IOnlineFilter
- Inheritance
-
CentralMovingAverageFilter
- Implements
-
IOnlineFilter
- Inherited Members
Constructors
CentralMovingAverageFilter(int)
Initializes a new instance of the CentralMovingAverageFilter class. This filter cannot be used as an on-line filter.
public CentralMovingAverageFilter(int windowSize)
Parameters
windowSizeintWindow size, must be greater than one.
Exceptions
- ArgumentOutOfRangeException
Thrown when
windowSizeis less than 1.- ArgumentException
Thrown
windowSizeis not an odd number.
Methods
ProcessSample(double)
Process a single sample.
public double ProcessSample(double sample)
Parameters
sampledoubleValue to filter.
Returns
- double
Filtered value.
Exceptions
- NotSupportedException
Always thrown.
ProcessSamples(double[])
Process a whole set of samples at once.
public double[] ProcessSamples(double[] samples)
Parameters
samplesdouble[]Values to filter.
Returns
- double[]
Filtered values.
Reset()
Resets internal state (not window size).
public void Reset()