Regularizes signal into [0,1] by rescaling it using the min and max values.
More...
#include <MinMaxScaler.h>
|
| | MinMaxScaler (Engine &engine=Engine::primary()) |
| | Default constructor.
|
| |
| | MinMaxScaler (float timeWindow, Engine &engine=Engine::primary()) |
| | Constructor with time window.
|
| |
|
float | minValue () const |
| | Returns the current min. value.
|
| |
|
float | maxValue () const |
| | Returns the current max. value.
|
| |
| virtual void | infiniteTimeWindow () |
| | Sets time window to infinite.
|
| |
| 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 | reset () |
| | Resets the moving filter.
|
| |
| virtual float | put (float value) |
| | Pushes value into the unit.
|
| |
|
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).
|
| |
| 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.
|
| |
| 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.
|
| |
|
| operator bool () |
| | Operator that allows usage in conditional expressions.
|
| |
|
|
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.
|
| |
|
| virtual void | step () |
| |
|
virtual void | begin () |
| |
| 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.
|
| |
|
|
float | _timeWindow |
| |
|
float | _minValue |
| |
|
float | _maxValue |
| |
|
float | _smoothedMinValue |
| |
|
float | _smoothedMaxValue |
| |
|
unsigned int | _nSamples |
| |
|
float | _currentValueStep |
| |
|
bool | _isCalibrating: 1 |
| |
|
uint8_t | _nValuesStep: 7 |
| |
|
float | _value |
| |
Regularizes signal into [0,1] by rescaling it using the min and max values.
◆ MinMaxScaler() [1/2]
Default constructor.
Assigns infinite time window.
- Parameters
-
| engine | the engine running this unit |
◆ MinMaxScaler() [2/2]
Constructor with time window.
- Parameters
-
| timeWindow | the time window (in seconds) |
| engine | the engine running this unit |
◆ eventTriggered()
| virtual bool pq::Unit::eventTriggered |
( |
EventType |
eventType | ) |
|
|
inlineprotectedvirtualinherited |
◆ get()
| virtual float pq::AnalogSource::get |
( |
| ) |
|
|
inlinevirtualinherited |
◆ infiniteTimeWindow()
| void pq::MinMaxScaler::infiniteTimeWindow |
( |
| ) |
|
|
virtual |
◆ mapTo()
| virtual float pq::AnalogSource::mapTo |
( |
float |
toLow, |
|
|
float |
toHigh |
|
) |
| |
|
inlinevirtualinherited |
◆ put()
| float pq::MinMaxScaler::put |
( |
float |
value | ) |
|
|
virtual |
Pushes value into the unit.
If isRunning() is false the filter will not be updated but will just return the filtered value.
- Parameters
-
| value | the value sent to the unit |
- Returns
- the new value of the unit
Reimplemented from pq::Chainable.
◆ reset()
| void pq::MinMaxScaler::reset |
( |
| ) |
|
|
virtual |
◆ resumeCalibrating()
| void pq::MovingFilter::resumeCalibrating |
( |
| ) |
|
|
virtualinherited |
Switches to calibration mode (default).
Calls to put(value) will return filtered value AND update the normalization statistics.
◆ step()
| void pq::MinMaxScaler::step |
( |
| ) |
|
|
protectedvirtual |
◆ timeWindow() [1/2]
| float pq::MinMaxScaler::timeWindow |
( |
| ) |
const |
|
virtual |
◆ timeWindow() [2/2]
| void pq::MinMaxScaler::timeWindow |
( |
float |
seconds | ) |
|
|
virtual |
◆ timeWindowIsInfinite()
| bool pq::MinMaxScaler::timeWindowIsInfinite |
( |
| ) |
const |
|
virtual |
The documentation for this class was generated from the following files:
- /home/tats/Documents/workspace/Plaquette/src/MinMaxScaler.h
- /home/tats/Documents/workspace/Plaquette/src/MinMaxScaler.cpp