Lens Scripting API

    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

    Index

    Constructors

    • Type Parameters

      • T

      Parameters

      • windowLength: number
      • zero: () => T
      • average: (samples: T[]) => T

      Returns MovingAverageFilter<T>

    Methods

    • Returns T

    • Returns void

    • Applies filter to a sample

      Parameters

      • sample: T

        value to be filtered

      • _timestamp: number

        timestamp when the sample was measured

      Returns T

    MMNEPVFCICPMFPCPTTAAATR