MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ hysteresis_gate()

MAYAFLUX_API bool MayaFlux::Kinesis::Discrete::hysteresis_gate ( double  input,
std::span< double >  coefs 
)
noexcept

Schmitt trigger: engages above high, releases below low, holds between.

coefs: [low, high, state].

Definition at line 77 of file Boolean.cpp.

78{
79 if (coefs.size() < 3)
80 return false;
81
82 if (input > coefs[1])
83 coefs[2] = 1.0;
84 else if (input < coefs[0])
85 coefs[2] = 0.0;
86 return coefs[2] > 0.5;
87}
Core::GlobalInputConfig input
Definition Config.cpp:42

References input.