|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Capture N reference points, then fit. More...
Capture N reference points, then fit.
The app decides when a reading has settled and calls capture() with the source's current reading. The last capture computes the fit. cancel() restores the fit that was in force when begin() was called, so an abandoned calibration costs nothing.
Definition at line 132 of file calibration.hpp.
#include <calibration.hpp>
Public Member Functions | |
| PointCalibration (const float(&references)[N]) | |
| void | begin () |
| bool | capture (float measured) |
| Record the source's reading for the current reference. | |
| void | accept () |
| void | cancel () |
| float | apply (float measured) const |
| Correct a reading; identity until a fit is computed or loaded. | |
| CalState | state () const |
| Where the routine is. | |
| bool | active () const |
| True while capturing points. | |
| uint8_t | point () const |
| Points captured so far: the index of the reference to patch next, for the UI. | |
| float | reference () const |
| The reference the app should patch for the current point. | |
| const LinearFit & | fit () const |
| The current fit. | |
| void | set_fit (const LinearFit &fit) |
| Load a stored fit (boot) or install one by hand. | |
Static Public Member Functions | |
| static constexpr uint8_t | points () |
| Points the routine captures. | |
|
inlineexplicit |
| references | the reference values, in the standard's units |
Definition at line 137 of file calibration.hpp.
|
inline |
Start capturing at point 0, remembering the current fit.
Definition at line 144 of file calibration.hpp.
References sbl::control::Capturing.
|
inline |
Record the source's reading for the current reference.
| measured | The source's reading, uncorrected |
Definition at line 155 of file calibration.hpp.
References sbl::control::Capturing, sbl::control::Done, sbl::control::Failed, and sbl::control::fit_points().
|
inline |
Leave the routine, keeping the new fit (the app persists it).
Definition at line 181 of file calibration.hpp.
References sbl::control::Done, and sbl::control::Idle.
|
inline |
Abandon: restore the fit from before begin().
Definition at line 188 of file calibration.hpp.
References sbl::control::Idle.
|
inline |
Correct a reading; identity until a fit is computed or loaded.
| measured | Measured value |
Definition at line 199 of file calibration.hpp.
References sbl::control::LinearFit::apply().
|
inline |
Where the routine is.
Definition at line 202 of file calibration.hpp.
|
inline |
True while capturing points.
Definition at line 204 of file calibration.hpp.
References sbl::control::Capturing.
|
inline |
Points captured so far: the index of the reference to patch next, for the UI.
Definition at line 207 of file calibration.hpp.
|
inlinestaticconstexpr |
Points the routine captures.
Definition at line 209 of file calibration.hpp.
|
inline |
The reference the app should patch for the current point.
Definition at line 212 of file calibration.hpp.
|
inline |
The current fit.
Definition at line 215 of file calibration.hpp.
Referenced by sbl::control::PointCalibration< N, Standard >::set_fit().
|
inline |
Load a stored fit (boot) or install one by hand.
| fit | The fit to use |
Definition at line 221 of file calibration.hpp.
References sbl::control::PointCalibration< N, Standard >::fit().