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

RedSmoothUD
ExtensionExtension

data filter

Description

A simple class for filtering values. Single exponential smoothing with different factors for increasing and decreasing values.

Similar to LagUD. See RedSlide for another implementation.

Class Methods

.new

Create a new filter.

Arguments:

factorUp

Smoothing for increasing values. Less is more.

factorDown

Smoothing for decreasing values. Less is more.

initVal

The 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

.factorUp

Dynamically set how much smoothing for increasing values.

.factorDown

Dynamically set how much smoothing for decreasing values.

.filter

Perform the smoothing.

.val

Get or set the current value.

Examples