|
| void | SimpleMovingAverage (int pSize, T pDefaultValue=0) |
| | Initialize Simple Moving Average Cyclic Buffer.
|
| |
| T | Add (T newSample) |
| | Add new value and return average value from buffer.
|
| |
| array< T > | GetSamples () |
| | Returns all the samples stored in the buffer.
|
| |
◆ SimpleMovingAverage()
| void SimpleMovingAverage |
( |
int |
pSize, |
|
|
T |
pDefaultValue = 0 |
|
) |
| |
|
inlineprivate |
Initialize Simple Moving Average Cyclic Buffer.
- Parameters
-
| pSize | size of the buffer |
| pDefaultValue | initial value stored in buffer |
◆ Add()
Add new value and return average value from buffer.
- Parameters
-
| newSample | value that will be added to buffer |
- Returns
- average value from the buffer
ref SimpleMovingAverage<float> m_Buffer = SimpleMovingAverage<float>(10, 0.5);
float sma = m_Buffer.Add(0.2);
◆ GetSamples()
| array< T > GetSamples |
( |
| ) |
|
|
inlineprivate |
Returns all the samples stored in the buffer.
◆ m_Pointer
| private int m_Pointer = 0 |
|
private |
◆ m_Samples
◆ m_Size
◆ m_Sum
The documentation for this class was generated from the following file: