![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Implements a minimum filter over a sliding window. More...
#include <MinFilter.h>
Public Member Functions | |
MinFilter (bool ignoreSame=true) | |
Constructs a MinFilter with the specified memory size and behavior. | |
float | Filter (float value) |
Filters the given value, updating the minimum 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 | minMemory = static_cast<int>(std::ceil(memory / 10.0)) |
Number of memory blocks for minimum tracking. | |
float | values [memory] |
Circular buffer of values. | |
float | minValues [memory/10] |
Array of minimum values in each block. | |
uint8_t | currentAmount = 0 |
Number of values currently stored in the buffer. | |
bool | ignoreSame |
Whether to ignore consecutive identical values. | |
Implements a minimum filter over a sliding window.
This class filters input data by maintaining a history of minimum values over a specified memory window. It is particularly useful for detecting and tracking minimum values in data streams.
memory | The size of the memory window for tracking minimum values. |
Definition at line 28 of file MinFilter.h.
Constructs a MinFilter
with the specified memory size and behavior.
ignoreSame | Whether to ignore consecutive identical values (default: true). |
Filters the given value, updating the minimum value within the memory window.
value | The input value to filter. |
Referenced by DerivativeFilter::Filter(), APDS9960::isBooped(), MicrophoneSimple::Update(), MMC56X3::Update(), Oscilloscope::Update(), and MicrophoneSimple::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 MinFilter.h.
Whether to ignore consecutive identical values.
Definition at line 34 of file MinFilter.h.
|
private |
Number of memory blocks for minimum tracking.
Definition at line 30 of file MinFilter.h.
Array of minimum values in each block.
Definition at line 32 of file MinFilter.h.
Circular buffer of values.
Definition at line 31 of file MinFilter.h.