

Public Member Functions | |
| virtual void | reset () |
| Resets the filter. | |
| virtual void | reset (float estimatedMeanValue) |
| Resets the filter with a prior estimate of the mean value. | |
| virtual void | reset (float estimatedMinValue, float estimatedMaxValue) |
| Resets the moving filter with a prior estimate of the min and max values. | |
| virtual void | resumeCalibrating () |
| Switches to calibration mode (default). | |
| virtual void | pauseCalibrating () |
| Switches to non-calibration mode: calls to put(value) will return filtered value without updating the normalization statistics. | |
| virtual void | toggleCalibrating () |
| Toggles calibration mode. | |
| virtual bool | isCalibrating () const |
| Returns true iff the moving filter is in calibration mode. | |
| unsigned int | nSamples () const |
| Returns the number of samples that have been processed thus far. | |
| virtual bool | isPreInitialized () const |
| Returns true if the moving filter has been initialized with a starting range at reset. | |
| virtual float | filter (float value)=0 |
| Returns the filtered value (without calibrating). | |
| virtual float | get () |
| Returns value in [0, 1]. | |
| virtual float | mapTo (float toLow, float toHigh) |
| Maps value to new range. | |
| 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 | put (float value) |
| Pushes value into the unit. | |
| operator bool () | |
| Operator that allows usage in conditional expressions. | |
| virtual void | infiniteTimeWindow () |
| Sets time window to infinite. | |
| virtual void | noTimeWindow () |
| Sets time window to no time window. | |
| virtual void | timeWindow (float seconds) |
| Changes the time window (expressed in seconds). | |
| virtual float | timeWindow () const |
| Returns the time window (expressed in seconds). | |
| virtual bool | timeWindowIsInfinite () const |
| Returns true if time window is infinite. | |
| virtual void | cutoff (float hz) |
| Changes the time window cutoff frequency (expressed in Hz). | |
| virtual float | cutoff () const |
| Returns the time window cutoff frequency (expressed in Hz). | |
Protected Member Functions | |
| MovingFilter (Engine &engine=Engine::primary()) | |
| Constructor. | |
| MovingFilter (float timeWindow, Engine &engine=Engine::primary()) | |
| Constructor with time window. | |
| virtual void | begin () |
| virtual float | alpha () const |
| virtual void | step () |
| virtual bool | eventTriggered (EventType eventType) |
| Returns true iff an event of a certain type has been triggered. | |
| virtual void | onEvent (EventCallback callback, EventType eventType) |
| Registers event callback. | |
| Engine * | engine () const |
| Returns the engine that owns this unit. | |
Protected Attributes | |
| bool | _isCalibrating: 1 |
| bool | _isPreInitialized: 1 |
| uint8_t | _nValuesStep: 6 |
| unsigned int | _nSamples |
| float | _value |
| float | _timeWindow |
|
protected |
Constructor.
| engine | the engine running this unit |
|
protected |
Constructor with time window.
| timeWindow | the time window (in seconds) |
| engine | the engine running this unit |
|
protectedvirtual |
Reimplemented from pq::Unit.
|
inlineprotectedvirtualinherited |
Returns true iff an event of a certain type has been triggered.
Reimplemented in pq::AbstractWave, pq::Alarm, pq::Metronome, pq::PeakDetector, pq::DigitalSource, pq::Ramp, pq::StreamIn, and pq::TimeSliceField< COUNT >.
|
pure virtual |
Returns the filtered value (without calibrating).
Implemented in pq::MinMaxScaler, pq::Normalizer, pq::RobustScaler, and pq::Smoother.
|
inlinevirtualinherited |
Returns value in [0, 1].
Reimplemented from pq::Flowable.
Reimplemented in pq::AbstractWave, and pq::RobustScaler.
|
inlinevirtualinherited |
Maps value to new range.
Reimplemented from pq::Flowable.
Reimplemented in pq::Normalizer, pq::StreamIn, and pq::StreamOut.
|
inlinevirtualinherited |
Pushes value into the unit.
| value | the value sent to the unit |
Reimplemented in pq::ParameterSlot< Obj >, pq::Chronometer, pq::MinMaxScaler, pq::Normalizer, pq::PeakDetector, pq::DigitalUnit, pq::AnalogOut, pq::AbstractServoOut, pq::Ramp, pq::RobustScaler, pq::Smoother, pq::StreamOut, pq::Monitor, pq::PivotField, pq::Plotter, pq::TimeSliceField< COUNT >, and pq::Value< T, Codec >.
|
virtual |
Resets the filter.
Reimplemented in pq::MinMaxScaler, pq::Normalizer, pq::RobustScaler, and pq::Smoother.
|
virtual |
Resets the filter with a prior estimate of the mean value.
Reimplemented in pq::MinMaxScaler, pq::Normalizer, pq::RobustScaler, and pq::Smoother.
|
virtual |
Resets the moving filter with a prior estimate of the min and max values.
Reimplemented in pq::MinMaxScaler, pq::Normalizer, pq::RobustScaler, and pq::Smoother.
|
virtual |
Switches to calibration mode (default).
Calls to put(value) will return filtered value AND update the normalization statistics.