DataSmoothing:
Filter:
OpenBCI-SuperCollider/Classes (extension) | External Control

DataSmoothing
ExtensionExtension

smooth data

Description

Smooth data using simple exponential smoothing. This class require one instance per board channel and is mainly useful in combination with DataFFT.

Class Methods

.new

create a new instance

Arguments:

factor

a Float from 0.0 to 1.0 where 0 is no smoothing.

Instance Methods

.factor

a Float

.filter

perform the filtering.

Arguments:

data

an Array of values.

Returns:

an Array of smoothed values.

.filterLog

smooth in dB power space

NOTE: CPU heavy and can not deal with values <=0.0

Arguments:

data

an Array of values.

Returns:

an Array of smoothed values.

Examples