Table of Contents

Class CentralMovingAverageFilter

Namespace
Loehnert.Waveforms.Filtering
Assembly
Loehnert.Waveforms.dll

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

windowSize int

Window size, must be greater than one.

Exceptions

ArgumentOutOfRangeException

Thrown when windowSize is less than 1.

ArgumentException

Thrown windowSize is not an odd number.

Methods

ProcessSample(double)

Process a single sample.

public double ProcessSample(double sample)

Parameters

sample double

Value 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

samples double[]

Values to filter.

Returns

double[]

Filtered values.

Reset()

Resets internal state (not window size).

public void Reset()