Hysteresis Binary State Trace
Trace explicit hysteresis state with inclusive outer thresholds and state retention strictly inside the band.
Description
Trace explicit hysteresis state with inclusive outer thresholds and state retention strictly inside the band.
Hysteresis uses two thresholds to prevent a binary state from switching repeatedly near one boundary. Samples between the thresholds preserve the current state.
When to use this tool
Trace explicit hysteresis state with inclusive outer thresholds and state retention strictly inside the band.
- Prepare the supplied values, lowerThreshold, upperThreshold, initialState fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter values, lowerThreshold, upperThreshold, initialState. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.states. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require lowerThreshold below upperThreshold and begin with initialState. At each sample set state true at or above the upper threshold, false at or below the lower threshold, and otherwise retain it. Return the state after every sample.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| values | values. | List of finite numbers; bounded by the operation |
| lowerThreshold | lower threshold. | Finite number |
| upperThreshold | upper threshold. | Finite number |
| initialState | Explicit choice for initial state; supply a boolean rather than a text label. | true or false |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.states | The states list in the ordering and representation described above. |
{
"input": {
"values": [
0,
2,
1,
0
],
"lowerThreshold": 0,
"upperThreshold": 2,
"initialState": false
},
"output": {
"result": {
"states": [
false,
true,
true,
false
]
}
}
} Limitations and assumptions
- Thresholds and initial state are caller choices. This is a discrete state trace without timing, debounce, analog interpolation or automatic threshold selection.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Choose a sampling model before combining results. Earlier-sample hold, linear interpolation and index-only differences answer different questions; event cooldown, debounce and rolling limits also use different acceptance rules.
References
Similar or alternative tools
- Event Cooldown Acceptance Trace
Accept the first event and later events at least the caller cooldown after the last accepted event; rejected events do not restart the cooldown.
- Event Rate Limit Acceptance Trace
Trace sliding-window rate limits over accepted events in (t−window,t]; rejected events do not consume acceptance capacity.