Smoothing.MovingAverageSmoother Method

Returns a delegate that Applies a moving average filter to a signal.

Definition

Namespace: Numerics.NET.SignalProcessing
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
public static Func<Vector<double>, Vector<double>> MovingAverageSmoother(
	int windowLength,
	Padding padding = Padding.None,
	double paddedValue = 0
)

Parameters

windowLength  Int32
The length of the smoothing window. Must be odd.
padding  Padding  (Optional)
(Optional.) Specifies how the signal is padded for calculations near the lower and upper bounds. The default value is None.
paddedValue  Double  (Optional)
(Optional.) If padding is Constant, the value to use for padding; ignored otherwise.

Return Value

Func<Vector<Double>, Vector<Double>>
The filtered signal.

Remarks

This method smooths a signal by computing the mean of a local neighbourhood of windowLength points around each data point.

The padding argument determines how calculations will be performed near the boundaries of the signal. The default value, None, indicates that the signal is not padded. Instead, only the available data points will be used to compute the first and last few smoothed values.

Exceptions

ArgumentOutOfRangeException

windowLength is less than zero.

See Also