template<typename TypeInput, typename TypeMid, uint16_t SIZE>
class AverageFilter< TypeInput, TypeMid, SIZE >
Filter with simple moving average algorithm.
- Template Parameters
-
| TypeInput | Type of the input samples. |
| TypeMid | Type used for intermediate calculations. |
| SIZE | Number of samples to average over. |
Definition at line 36 of file SignalProcessing.hpp.
template<typename TypeInput , typename TypeMid , uint16_t SIZE>
| void AverageFilter< TypeInput, TypeMid, SIZE >::addSample |
( |
TypeInput |
sample | ) |
|
|
overridevirtual |
Adds a new sample to the AverageFilter. Stores the sample in the circular buffer and updates the index.
- Template Parameters
-
| TypeInput | Type of the input samples. |
| TypeMid | Type used for intermediate calculations. |
| SIZE | Number of samples to average over. |
- Parameters
-
| sample | New input sample to add. |
Implements Filter< TypeInput, TypeMid >.
Definition at line 33 of file SignalProcessing.tpp.
template<typename TypeInput , typename TypeMid , uint16_t SIZE>
Retrieves the filtered value from the AverageFilter. Computes the average of the samples in the circular buffer.
- Template Parameters
-
| TypeInput | Type of the input samples. |
| TypeMid | Type used for intermediate calculations. |
| SIZE | Number of samples to average over. |
- Returns
- Filtered average value.
Implements Filter< TypeInput, TypeMid >.
Definition at line 48 of file SignalProcessing.tpp.