Table of Contents

Class MovingAverageFilter

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

Represents a simple moving average filter.

public class MovingAverageFilter : IOnlineFilter
Inheritance
MovingAverageFilter
Implements
IOnlineFilter
Inherited Members

Constructors

MovingAverageFilter(int)

Initializes a new instance of the MovingAverageFilter class.

public MovingAverageFilter(int windowSize)

Parameters

windowSize int

Window size, which is the number of averaged values. Must be greater than one.

Exceptions

ArgumentOutOfRangeException

Thrown when windowSize is less than one.

Methods

ProcessSample(double)

Process a single sample.

public double ProcessSample(double sample)

Parameters

sample double

Value to filter.

Returns

double

Filtered value.

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()