RedSmooth:
Filter:
redSys/Classes (extension) | Red > redTools

RedSmooth
ExtensionExtension

data filter

Description

A simple class for filtering values. Single exponential smoothing.

Similar to Lag. See RedSlide for another implementation.

Class Methods

.new

Create a new filter.

Arguments:

factor

A Float. Less is more.

initVal

Initial value.

Discussion:

Note that a factor of 0.0 will 'freeze' the filter, and factors above 1.0 will be unstable - overshoot, ring and even start to oscillate.

Instance Methods

.factor

How much smoothing.

.filter

Perform the smoothing.

.val

Get or set the current value.

Examples