|
| | PeakDetector (float triggerThreshold, Engine &engine=Engine::primary()) |
| | Constructor with default mode (PEAK_MAX).
|
| |
| | PeakDetector (float triggerThreshold, uint8_t mode, Engine &engine=Engine::primary()) |
| | Constructor.
|
| |
|
void | triggerThreshold (float triggerThreshold) |
| | Sets triggerThreshold.
|
| |
|
float | triggerThreshold () const |
| | Returns triggerThreshold.
|
| |
|
void | reloadThreshold (float reloadThreshold) |
| | Sets minimal threshold that "resets" peak detection in crossing (rising/falling) and peak (min/max) modes.
|
| |
|
float | reloadThreshold () const |
| | Returns minimal value "drop" for reset.
|
| |
|
void | fallbackTolerance (float fallbackTolerance) |
| | Sets minimal relative "drop" after peak to trigger detection in peak (min/max) modes, expressed as proportion (%) of peak minus triggerThreshold.
|
| |
|
float | fallbackTolerance () const |
| | Returns minimal relative "drop" after peak to trigger detection in peak modes.
|
| |
|
bool | modeInverted () const |
| | Returns true if mode is PEAK_FALLING or PEAK_MIN.
|
| |
|
bool | modeCrossing () const |
| | Returns true if mode is PEAK_RISING or PEAK_FALLING.
|
| |
|
bool | modeApex () const |
| | Returns true if mode is PEAK_MAX or PEAK_MIN.
|
| |
|
void | mode (uint8_t mode) |
| | Sets mode.
|
| |
|
uint8_t | mode () const |
| | Returns mode.
|
| |
| virtual float | put (float value) |
| | Pushes value into the unit.
|
| |
| virtual bool | isOn () |
| | Returns true iff the triggerThreshold is crossed.
|
| |
|
virtual void | onBang (EventCallback callback) |
| | Registers event callback on peak detection.
|
| |
|
virtual bool | isOff () |
| | Returns true iff the input is "off".
|
| |
|
virtual int | getInt () |
| | Returns value as integer (0 or 1).
|
| |
| virtual float | get () |
| | Returns value as float (either 0.0 or 1.0).
|
| |
|
virtual bool | on () |
| | Sets output to "on" (ie. true, 1).
|
| |
|
virtual bool | off () |
| | Sets output to "off" (ie. false, 0).
|
| |
| virtual bool | putOn (bool value) |
| | Pushes value into the unit.
|
| |
| virtual float | mapTo (float toLow, float toHigh) |
| | Maps value to new range.
|
| |
|
| operator bool () |
| | Operator that allows usage in conditional expressions.
|
| |
|
| operator float () |
| |
|
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.
|
| |
Emits a "bang" signal when another signal peaks.