|
| | Smoother (Engine &engine=Engine::primary()) |
| | Constructor with default smoothing.
|
| |
| | Smoother (float smoothingWindow, Engine &engine=Engine::primary()) |
| | Constructor with smoothing window.
|
| |
| virtual float | put (float value) |
| | Pushes value into the unit.
|
| |
| virtual float | get () |
| | Returns smoothed value.
|
| |
|
virtual void | clearEvents () |
| |
|
float | seconds () const |
| | Returns engine time in seconds.
|
| |
|
uint32_t | milliSeconds () const |
| | Returns engine time in milliseconds.
|
| |
|
uint64_t | microSeconds () const |
| | Returns engine time in microseconds.
|
| |
|
unsigned long | nSteps () const |
| | Returns number of engine steps.
|
| |
|
float | sampleRate () const |
| | Returns engine sample rate.
|
| |
|
float | samplePeriod () const |
| | Returns enginesample period.
|
| |
|
| operator float () |
| | Object can be used directly to access its value.
|
| |
| virtual float | mapTo (float toLow, float toHigh) |
| | Maps value to new range.
|
| |
|
| operator bool () |
| | Operator that allows usage in conditional expressions.
|
| |
|
void | infiniteTimeWindow () |
| | Sets to "infinite" smoothing window.
|
| |
|
void | timeWindow (float seconds) |
| | Changes the smoothing window (expressed in seconds).
|
| |
|
float | timeWindow () const |
| | Returns the smoothing window (expressed in seconds).
|
| |
|
bool | timeWindowIsInfinite () const |
| | Returns true if time window is infinite.
|
| |
|
void | cutoff (float hz) |
| | Changes the smoothing window cutoff frequency (expressed in Hz).
|
| |
|
float | cutoff () const |
| | Returns the smoothing window cutoff frequency (expressed in Hz).
|
| |
|
float | alpha (float sampleRate) const |
| | Returns the alpha value computed from given sample rate.
|
| |
|
void | reset () |
| | Resets the moving average.
|
| |
|
virtual float | update (float v, float sampleRate=1, bool forceAlpha=false) |
| | Updates the moving average with new value v# (also returns the current value).
|
| |
|
float | constGet () const |
| |
|
unsigned int | nSamples () const |
| | Returns the number of samples processed since reset().
|
| |
|
void | amendUpdate (float previousValue, float newValue, float sampleRate=1, bool forceAlpha=false) |
| | Performs an amendment of latest update (needs to be called with same sampleRate# and forceAlpha# parameters).
|
| |
|
|
static bool | analogToDigital (float f) |
| | Converts analog (float) value to digital (bool) value.
|
| |
|
static float | digitalToAnalog (bool b) |
| | Converts digital (bool) value to analog (float) value.
|
| |
|
static float | alpha (float sampleRate, float timeWindow, unsigned int nSamples=UINT_MAX) |
| | Returns the alpha value computed from given sample rate, time window, and number of samples.
|
| |
|
static void | applyUpdate (float &runningValue, float newValue, float alpha) |
| | Applies a single update on runningValue# with new sample newValue# and mixing factor alpha#.
|
| |
|
static void | applyAmendUpdate (float &runningValue, float previousValue, float newValue, float alpha) |
| | Performs an amendment of latest update (needs to be called with same alpha# parameter).
|
| |
|
static float | computeUpdate (float runningValue, float newValue, float alpha) |
| | Computes a single update on runningValue# with new sample newValue# and mixing factor alpha#.
|
| |
Simple moving average transform filter.