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

RedSmooth2
ExtensionExtension

data filter with trend

Description

A simple class for filtering values. Double exponential smoothing.

Class Methods

.new

Create a new filter.

Arguments:

factor

A Float. Less is more.

factor2

A Float. Trend smoothing factor.

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.

.factor2

How much smoothing of trend.

.filter

Perform the smoothing.

.val

Get or set the current value.

.trend

Get or set the current trend.

Examples