![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Implements a maximum filter over a sliding window. More...
#include <MaxFilter.h>
Public Member Functions | |
MaxFilter () | |
Constructs a MaxFilter with the specified memory size. | |
float | Filter (float value) |
Filters the given value, updating the maximum value within the memory window. | |
Private Member Functions | |
void | ShiftArray (uint8_t mem, float *arr) |
Shifts the values in the specified array to make room for a new value. | |
Private Attributes | |
const int | maxMemory = static_cast<int>(std::ceil(memory / 10.0)) |
Number of memory blocks for peak tracking. | |
float | values [memory] |
Circular buffer of values. | |
float | maxValues [memory/10] |
Array of maximum values in each block. | |
uint8_t | currentAmount = 0 |
Number of values currently stored in the buffer. | |
Implements a maximum filter over a sliding window.
This class filters input data by maintaining a history of maximum values over a specified memory window. It is particularly useful for detecting and tracking peak values in data streams.
memory | The size of the memory window for tracking maximum values. |
Definition at line 28 of file MaxFilter.h.
Filters the given value, updating the maximum value within the memory window.
value | The input value to filter. |
Referenced by Oscilloscope::Update().
Shifts the values in the specified array to make room for a new value.
mem | The size of the array. |
arr | The array to shift. |
Number of values currently stored in the buffer.
Definition at line 33 of file MaxFilter.h.
|
private |
Number of memory blocks for peak tracking.
Definition at line 30 of file MaxFilter.h.
Array of maximum values in each block.
Definition at line 32 of file MaxFilter.h.
Circular buffer of values.
Definition at line 31 of file MaxFilter.h.