Implements a moving average algorithm. A window of specified length, moves over the data, sample by sample, and the average is computed over the data in the window.

Source: https://www.mathworks.com/help/dsp/ug/sliding-window-method-and-exponential-weighting-method.html

Type Parameters

  • T

Implements

Constructors

Methods

Constructors

  • Type Parameters

    • T

    Parameters

    • windowLength: number
    • zero: (() => T)
        • (): T
        • Returns T

    • average: ((samples: T[]) => T)
        • (samples): T
        • Parameters

          • samples: T[]

          Returns T

    Returns MovingAverageFilter<T>

Methods

  • Returns void

  • Parameters

    • sample: T
    • _timestamp: number

    Returns T