|
Sound Byte Libs 0.5.1-121-g3358a44
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 su. 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 112 of file calibration.hpp.
#include <calibration.hpp>
Public Member Functions | |
| PointCalibration (const float(&references)[N]) | |
| void | begin () |
| Start capturing at point 0, remembering the current fit. | |
| bool | capture (float measured_su) |
| Record the source's reading for the current reference. | |
| void | accept () |
| Leave the routine, keeping the new fit (the app persists it). | |
| void | cancel () |
| Abandon: restore the fit from before begin(). | |
| float | apply (float measured_su) const |
| Correct a reading. Identity until a fit is computed or loaded. | |
| CalState | state () const |
| bool | active () const |
| uint8_t | point () const |
| Points captured so far — 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 |
| 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 () |
|
inlineexplicit |
| references | the reference values, in the standard's units |
Definition at line 117 of file calibration.hpp.
|
inline |
Start capturing at point 0, remembering the current fit.
Definition at line 122 of file calibration.hpp.
References sbl::control::Capturing.
|
inline |
Record the source's reading for the current reference.
Definition at line 132 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 152 of file calibration.hpp.
References sbl::control::Done, and sbl::control::Idle.
|
inline |
Abandon: restore the fit from before begin().
Definition at line 157 of file calibration.hpp.
References sbl::control::Idle.
|
inline |
Correct a reading. Identity until a fit is computed or loaded.
Definition at line 164 of file calibration.hpp.
References sbl::control::LinearFit::apply().
|
inline |
Definition at line 166 of file calibration.hpp.
|
inline |
Definition at line 167 of file calibration.hpp.
References sbl::control::Capturing.
|
inline |
Points captured so far — the reference to patch next, for the UI.
Definition at line 170 of file calibration.hpp.
|
inlinestaticconstexpr |
Definition at line 171 of file calibration.hpp.
|
inline |
The reference the app should patch for the current point.
Definition at line 174 of file calibration.hpp.
|
inline |
Definition at line 176 of file calibration.hpp.
Referenced by sbl::control::PointCalibration< N, Standard >::set_fit().
Load a stored fit (boot) or install one by hand.
Definition at line 179 of file calibration.hpp.
References sbl::control::PointCalibration< N, Standard >::fit().