Rapid-Mix API  v2.0.0
A simple library for machine learning & signal processing
rapidStream Class Reference

#include <rapidStream.h>

Collaboration diagram for rapidStream:
Collaboration graph

Public Member Functions

 rapidStream ()
 
 rapidStream (int windowSize)
 
 ~rapidStream ()
 
void clear ()
 
void pushToWindow (double input)
 
double velocity ()
 
double acceleration ()
 
double minimum ()
 
double maximum ()
 
double sum ()
 
double mean ()
 
double standardDeviation ()
 
double minVelocity ()
 
double maxVelocity ()
 
double minAcceleration ()
 
double maxAcceleration ()
 

Constructor & Destructor Documentation

§ rapidStream() [1/2]

rapidStream::rapidStream ( )

Create a circular buffer with 3 elements.

§ rapidStream() [2/2]

rapidStream::rapidStream ( int  windowSize)

Create a circular buffer with an arbitrary number of elements.

Parameters
intnumber of elements to hold in the buffer

§ ~rapidStream()

rapidStream::~rapidStream ( )

Member Function Documentation

§ acceleration()

double rapidStream::acceleration ( )

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

Returns
double: acceleration over the last three inputs.

§ clear()

void rapidStream::clear ( )

Resets all the values in the buffer to zero.

§ maxAcceleration()

double rapidStream::maxAcceleration ( )

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

Returns
double: maximum acceleration.

§ maximum()

double rapidStream::maximum ( )

Find the maximum value in the buffer.

Returns
double: maximum.

§ maxVelocity()

double rapidStream::maxVelocity ( )

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

Returns
double: maximum velocity.

§ mean()

double rapidStream::mean ( )

Calculate the mean of all values in the buffer.

Returns
double: mean.

§ minAcceleration()

double rapidStream::minAcceleration ( )

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

Returns
double: minimum acceleration.

§ minimum()

double rapidStream::minimum ( )

Find the minimum value in the buffer.

Returns
double: minimum.

§ minVelocity()

double rapidStream::minVelocity ( )

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

Returns
double: minimum velocity.

§ pushToWindow()

void rapidStream::pushToWindow ( double  input)

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

Parameters
doublevalue to be pushed into circular buffer.

§ standardDeviation()

double rapidStream::standardDeviation ( )

Calculate the standard deviation of all values in the buffer.

Returns
double: standard deviation.

§ sum()

double rapidStream::sum ( )

Calculate the sum of all values in the buffer.

Returns
double: sum.

§ velocity()

double rapidStream::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: