4#include "./../types.hpp"
8template <
bool MeanChannel=true>
19 volatile uint32_t Count = 0;
22 template<
typename DataType>
25 Accumulate += (float_t)data;
31 float_t
mean() const __attribute__((always_inline))
34 return float_t(this->Accumulate)/ float_t(this->Count);
57 volatile uint32_t Count = 0;
67 float_t
mean() const __attribute__((always_inline))
119 CGFactor(uint32_t(std::floor(coarsing_interval / minimum_resolution))),
Error(coarsing_interval -
CGFactor)
128 template <
typename DataType>
AccumulateType accumulate() const __attribute__((always_inline))
Returns the accumulate so far, which is the same as 'Count`.
Definition: monitor_channel.hpp:73
uint32_t AccumulateType
Definition: monitor_channel.hpp:56
void reset()
Definition: monitor_channel.hpp:78
void push_back() __attribute__((always_inline))
Definition: monitor_channel.hpp:61
float_t mean() const __attribute__((always_inline))
Definition: monitor_channel.hpp:67
void reset()
Definition: monitor_channel.hpp:43
void push_back(DataType data)
Adds datum to the channel.
Definition: monitor_channel.hpp:23
float_t mean() const __attribute__((always_inline))
Returns the estimated mean.
Definition: monitor_channel.hpp:31
AccumulateType accumulate() const __attribute__((always_inline))
Returns the Accumulate so far.
Definition: monitor_channel.hpp:38
float AccumulateType
Definition: monitor_channel.hpp:15
A simple Averager Class that calculates the estimated mean. Template parameter Construct specifies a ...
Definition: monitor_channel.hpp:9
An object that can accumulate data into a fixed size bin before changing its output value.
Definition: monitor_channel.hpp:108
float error() const
Returns the discretization error.
Definition: monitor_channel.hpp:148
float output() const
Returns the last available coarse-grained value.
Definition: monitor_channel.hpp:142
float Out
Last Ready Coarse Grained Value.
Definition: monitor_channel.hpp:111
constexpr RTCoarseGrainer(float coarsing_interval, float minimum_resolution)
Constructor that accepts a coarsening_interval and the minimum_resolution of data and assumes the coa...
Definition: monitor_channel.hpp:118
float Accumulate
Accumulate of the data.
Definition: monitor_channel.hpp:110
float Error
Error in the coarsening interval due to discretization.
Definition: monitor_channel.hpp:114
void push_back(const DataType datum)
Updates the RTCoarseGrainer object with the passed datum.
Definition: monitor_channel.hpp:129
const uint32_t CGFactor
Number of points that are coarse-grained together.
Definition: monitor_channel.hpp:113
uint32_t UpdateCntr
Local counter that keep tracks of the updates made.
Definition: monitor_channel.hpp:112
constexpr RTCoarseGrainer(float coarsing_interval)
Constructor that accepts a coarsening_interval and the minimum_resolution of data and assumes the coa...
Definition: monitor_channel.hpp:124
Measures the zeroth auto-correlation, which is equal to the second moment of the sampled time series....
Definition: monitor_channel.hpp:88
void push_back(counter_t datum) __attribute__((always_inline))
Definition: monitor_channel.hpp:92
float_t Second_Moment
Definition: monitor_channel.hpp:90
float_t get_output() __attribute__((always_inline))
Definition: monitor_channel.hpp:97
uint32_t counter_t
Data type received from the pulse counter. It is the fundamental type used for representing series da...
Definition: types.hpp:7