10#ifndef SIGNAL_PROCESSING_HPP
11#define SIGNAL_PROCESSING_HPP
21template <
typename TypeInput,
typename TypeM
id>
35template <
typename TypeInput,
typename TypeM
id, u
int16_t SIZE>
40 void addSample(TypeInput sample)
override;
58template <
typename TypeInput,
typename TypeM
id, u
int8_t OLD_RATIO = 31, u
int8_t NEW_RATIO = 1>
63 void addSample(TypeInput sample)
override;
Definition of Signal Processing functions.
Filter with simple moving average algorithm.
void addSample(TypeInput sample) override
Adds a new sample to the AverageFilter. Stores the sample in the circular buffer and updates the inde...
TypeInput getFiltered() const override
Retrieves the filtered value from the AverageFilter. Computes the average of the samples in the circu...
AverageFilter()
Constructor for AverageFilter. Initializes the circular buffer to zero.
Filter with exponential moving average algorithm.
void addSample(TypeInput sample) override
Adds a new sample to the ExponentialFilter. Updates the filtered value using the exponential moving a...
ExponentialFilter()
Constructor for ExponentialFilter. Initializes the last output value to zero.
TypeInput getFiltered() const override
Retrieves the filtered value from the ExponentialFilter.
Abstract Base Class for signal filters. Defines the interface for adding samples and retrieving filte...
virtual void addSample(TypeInput sample)=0
virtual TypeInput getFiltered() const =0