RapidLib  v2.2.0
A simple library for interactive machine learning
rapidLib::rapidStream< T > Class Template Reference

#include <rapidStream.h>

Collaboration diagram for rapidLib::rapidStream< T >:
Collaboration graph

Public Member Functions

 rapidStream ()
 
 rapidStream (std::size_t windowSize)
 
 ~rapidStream ()
 
void clear ()
 
void pushToWindow (T input)
 
velocity () const
 
acceleration () const
 
minimum () const
 
maximum () const
 
uint32_t numZeroCrossings () const
 
sum () const
 
mean () const
 
standardDeviation () const
 
rms () const
 
bayesFilter (T inputValue)
 
void bayesSetDiffusion (float logDiffusion)
 
void bayesSetJumpRate (float jump_rate)
 
void bayesSetMVC (float mvc)
 
minVelocity () const
 
maxVelocity () const
 
minAcceleration () const
 
maxAcceleration () const
 

Constructor & Destructor Documentation

◆ rapidStream() [1/2]

template<typename T >
rapidLib::rapidStream< T >::rapidStream

Create a circular buffer with 3 elements.

◆ rapidStream() [2/2]

template<typename T >
rapidLib::rapidStream< T >::rapidStream ( std::size_t  windowSize)

Create a circular buffer with an arbitrary number of elements.

Parameters
intnumber of elements to hold in the buffer

◆ ~rapidStream()

template<typename T >
rapidLib::rapidStream< T >::~rapidStream

Member Function Documentation

◆ acceleration()

template<typename T >
T rapidLib::rapidStream< T >::acceleration

Calculate the second-order difference (aka acceleration) over the last three inputs.

Returns
double: acceleration over the last three inputs.

◆ bayesFilter()

template<typename T >
T rapidLib::rapidStream< T >::bayesFilter ( inputValue)

Non-linear Baysian filtering for EMG envelope extraction.

Returns
current envelope value

◆ bayesSetDiffusion()

template<typename T >
void rapidLib::rapidStream< T >::bayesSetDiffusion ( float  logDiffusion)

◆ bayesSetJumpRate()

template<typename T >
void rapidLib::rapidStream< T >::bayesSetJumpRate ( float  jump_rate)

◆ bayesSetMVC()

template<typename T >
void rapidLib::rapidStream< T >::bayesSetMVC ( float  mvc)

◆ clear()

template<typename T >
void rapidLib::rapidStream< T >::clear

Resets all the values in the buffer to zero.

◆ maxAcceleration()

template<typename T >
T rapidLib::rapidStream< T >::maxAcceleration

Calculate the maximum second-order difference over consecutive inputs in the buffer.

Returns
double: maximum acceleration.

◆ maximum()

template<typename T >
T rapidLib::rapidStream< T >::maximum

Find the maximum value in the buffer.

Returns
double: maximum.

◆ maxVelocity()

template<typename T >
T rapidLib::rapidStream< T >::maxVelocity

Calculate the maximum first-order difference over consecutive inputs in the buffer.

Returns
double: maximum velocity.

◆ mean()

template<typename T >
T rapidLib::rapidStream< T >::mean

Calculate the mean of all values in the buffer.

Returns
double: mean.

◆ minAcceleration()

template<typename T >
T rapidLib::rapidStream< T >::minAcceleration

Calculate the minimum second-order difference over consecutive inputs in the buffer.

Returns
double: minimum acceleration.

◆ minimum()

template<typename T >
T rapidLib::rapidStream< T >::minimum

Find the minimum value in the buffer.

Returns
double: minimum.

◆ minVelocity()

template<typename T >
T rapidLib::rapidStream< T >::minVelocity

Calculate the minimum first-order difference over consecutive inputs in the buffer.

Returns
double: minimum velocity.

◆ numZeroCrossings()

template<typename T >
uint32_t rapidLib::rapidStream< T >::numZeroCrossings

Count the number of zero crossings in the buffer.

Returns
int: number of zero crossings.

◆ pushToWindow()

template<typename T >
void rapidLib::rapidStream< T >::pushToWindow ( input)

Add a value to a circular buffer whose size is defined at creation.

Parameters
doublevalue to be pushed into circular buffer.

◆ rms()

template<typename T >
T rapidLib::rapidStream< T >::rms

Calculate the root mean square of the values in the buffer

Returns
double: rms

◆ standardDeviation()

template<typename T >
T rapidLib::rapidStream< T >::standardDeviation

Calculate the standard deviation of all values in the buffer.

Returns
double: standard deviation.

◆ sum()

template<typename T >
T rapidLib::rapidStream< T >::sum

Calculate the sum of all values in the buffer.

Returns
T: sum.

◆ velocity()

template<typename T >
T rapidLib::rapidStream< T >::velocity

Calculate the first-order difference (aka velocity) between the last two inputs.

Returns
double: difference between last two inputs.

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