Class MovingAverage
Utility to manage a moving average of a time series.
Namespace: Microsoft.MixedReality.WebRTC
Assembly: Microsoft.MixedReality.WebRTC.dll
Syntax
public class MovingAverage : object
Constructors
| Improve this Doc View SourceMovingAverage(Int32)
Create a new moving average with a given window size.
Declaration
public MovingAverage(int capacity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | capacity | The capacity of the sample window. |
Properties
| Improve this Doc View SourceAverage
Average value of the samples.
Declaration
public float Average { get; }
Property Value
Type | Description |
---|---|
Single |
Capacity
Number of samples in the moving average window.
Declaration
public int Capacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceClear()
Clear the moving average and discard all cached samples.
Declaration
public void Clear()
Push(Single)
Push a new sample and recalculate the current average.
Declaration
public void Push(float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | The new value to add. |