Class: StreamBuffer

StreamBuffer(windowSizeopt)

new StreamBuffer(windowSizeopt)

Creates a circular buffer that can return various statistics
Parameters:
Name Type Attributes Default Description
windowSize number <optional>
3 specify the size of the buffer
Properties:
Name Type Description
Module.rapidStreamCpp function constructor from emscripten
Source:

Methods

acceleration() → {number}

Calculate the second-order difference (aka acceleration) over the last three inputs.
Source:
Returns:
acceleration over the last three inputs.
Type
number

maxAcceleration() → {number}

Calculate the maximum second-order difference over consecutive inputs in the buffer.
Source:
Returns:
maximum acceleration.
Type
number

maximum() → {number}

Find the maximum value in the buffer.
Source:
Returns:
maximum.
Type
number

maxVelocity() → {number}

Calculate the maximum first-order difference over consecutive inputs in the buffer.
Source:
Returns:
maximum velocity.
Type
number

mean() → {number}

Calculate the mean of all values in the buffer.
Source:
Returns:
mean.
Type
number

minAcceleration() → {number}

Calculate the minimum second-order difference over consecutive inputs in the buffer.
Source:
Returns:
minimum acceleration.
Type
number

minimum() → {number}

Find the minimum value in the buffer.
Source:
Returns:
minimum.
Type
number

minVelocity() → {number}

Calculate the minimum first-order difference over consecutive inputs in the buffer.
Source:
Returns:
minimum velocity.
Type
number

push(input)

Add a value to a circular buffer whose size is defined at creation.
Parameters:
Name Type Description
input number value to be pushed into circular buffer.
Source:

reset()

Resets all the values in the buffer to zero.
Source:

rms() → {number}

Calculate the root mean square of the values in the buffer
Source:
Returns:
rms
Type
number

standardDeviation() → {number}

Calculate the standard deviation of all values in the buffer.
Source:
Returns:
standard deviation.
Type
number

sum() → {number}

Calculate the sum of all values in the buffer.
Source:
Returns:
sum.
Type
number

velocity() → {number}

Calculate the first-order difference (aka velocity) between the last two inputs.
Source:
Returns:
difference between last two inputs.
Type
number