15#include "../Math/Mathematics.h"
27template<
size_t memory>
30 const int maxMemory =
static_cast<int>(std::ceil(memory / 10.0));
Implements a maximum filter over a sliding window.
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.
MaxFilter()
Constructs a MaxFilter with the specified memory size.
float values[memory]
Circular buffer of values.
float Filter(float value)
Filters the given value, updating the maximum value within the memory window.
const int maxMemory
Number of memory blocks for peak tracking.
float maxValues[memory/10]
Array of maximum values in each block.