15#include "../Math/Mathematics.h"
27template<
size_t memory>
30 const int minMemory =
static_cast<int>(std::ceil(memory / 10.0));
Implements a minimum filter over a sliding window.
MinFilter(bool ignoreSame=true)
Constructs a MinFilter with the specified memory size and behavior.
const int minMemory
Number of memory blocks for minimum tracking.
uint8_t currentAmount
Number of values currently stored in the buffer.
void ShiftArray(uint8_t mem, float *arr)
Shifts the values in the specified array to make room for a new value.
float values[memory]
Circular buffer of values.
float Filter(float value)
Filters the given value, updating the minimum value within the memory window.
bool ignoreSame
Whether to ignore consecutive identical values.
float minValues[memory/10]
Array of minimum values in each block.