DIY Auto-Correlator 1.0
Auto-Correlator Card implementation using Teensy 4.x microcontrollers.
Public Member Functions | Public Attributes | List of all members
RTCoarseGrainer Class Reference

An object that can accumulate data into a fixed size bin before changing its output value. More...

#include <monitor_channel.hpp>

Public Member Functions

constexpr RTCoarseGrainer (float coarsing_interval, float minimum_resolution)
 Constructor that accepts a coarsening_interval and the minimum_resolution of data and assumes the coarse graining factor (CGFactor) as the coarsening_interval divide by minimum_resolution. More...
 
constexpr RTCoarseGrainer (float coarsing_interval)
 Constructor that accepts a coarsening_interval and the minimum_resolution of data and assumes the coarse graining factor (CGFactor) as the coarsening_interval divide by minimum_resolution. More...
 
template<typename DataType >
void push_back (const DataType datum)
 Updates the RTCoarseGrainer object with the passed datum. More...
 
float output () const
 Returns the last available coarse-grained value. More...
 
float error () const
 Returns the discretization error. More...
 

Public Attributes

float Accumulate = 0.0
 Accumulate of the data. More...
 
float Out = 0.0
 Last Ready Coarse Grained Value. More...
 
uint32_t UpdateCntr = 0
 Local counter that keep tracks of the updates made. More...
 
const uint32_t CGFactor
 Number of points that are coarse-grained together. More...
 
float Error = 0.0
 Error in the coarsening interval due to discretization. More...
 

Detailed Description

An object that can accumulate data into a fixed size bin before changing its output value.

Constructor & Destructor Documentation

◆ RTCoarseGrainer() [1/2]

constexpr RTCoarseGrainer::RTCoarseGrainer ( float  coarsing_interval,
float  minimum_resolution 
)
inlineconstexpr

Constructor that accepts a coarsening_interval and the minimum_resolution of data and assumes the coarse graining factor (CGFactor) as the coarsening_interval divide by minimum_resolution.

◆ RTCoarseGrainer() [2/2]

constexpr RTCoarseGrainer::RTCoarseGrainer ( float  coarsing_interval)
inlineconstexpr

Constructor that accepts a coarsening_interval and the minimum_resolution of data and assumes the coarse graining factor (CGFactor) as the coarsening_interval divide by minimum_resolution.

Member Function Documentation

◆ error()

float RTCoarseGrainer::error ( ) const
inline

Returns the discretization error.

◆ output()

float RTCoarseGrainer::output ( ) const
inline

Returns the last available coarse-grained value.

◆ push_back()

template<typename DataType >
void RTCoarseGrainer::push_back ( const DataType  datum)
inline

Updates the RTCoarseGrainer object with the passed datum.

Member Data Documentation

◆ Accumulate

float RTCoarseGrainer::Accumulate = 0.0

Accumulate of the data.

◆ CGFactor

const uint32_t RTCoarseGrainer::CGFactor

Number of points that are coarse-grained together.

◆ Error

float RTCoarseGrainer::Error = 0.0

Error in the coarsening interval due to discretization.

◆ Out

float RTCoarseGrainer::Out = 0.0

Last Ready Coarse Grained Value.

◆ UpdateCntr

uint32_t RTCoarseGrainer::UpdateCntr = 0

Local counter that keep tracks of the updates made.


The documentation for this class was generated from the following file: