Piecewise Linear Crossing Times
Find piecewise-linear threshold crossing times and explicit threshold plateaus; shared endpoint times are deduplicated.
Description
Find piecewise-linear threshold crossing times and explicit threshold plateaus; shared endpoint times are deduplicated.
Linear segments can cross a threshold at isolated times or coincide with it for an entire interval. Recording both forms avoids turning a plateau into a single crossing.
When to use this tool
Find piecewise-linear threshold crossing times and explicit threshold plateaus; shared endpoint times are deduplicated.
- Prepare the supplied times, values, threshold 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 times, values, threshold. 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.crossingTimes, result.thresholdPlateauIntervals. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require aligned samples with strictly increasing times. Interpolate threshold times on nonflat segments whose endpoint values bracket the threshold, deduplicate those times, and separately return segments whose endpoints both equal the threshold.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| times | times. | List of finite numbers; bounded by the operation |
| values | values. | List of finite numbers; bounded by the operation |
| threshold | threshold. | Finite number |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.crossingTimes | The crossing times list in the ordering and representation described above. |
| result.thresholdPlateauIntervals | The threshold plateau intervals list in the ordering and representation described above. |
{
"input": {
"times": [
0,
2
],
"values": [
0,
4
],
"threshold": 2
},
"output": {
"result": {
"crossingTimes": [
1
],
"thresholdPlateauIntervals": []
}
}
} Limitations and assumptions
- Adjacent plateau intervals are not merged. Endpoint equality uses exact floating-point comparisons; no smoothing or uncertainty band is applied between measurements.
- 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
- Consecutive Threshold Streaks
Tabulate sampled consecutive threshold streaks with explicit at-or-above versus strictly-below convention; no between-sample duration inference.
- Counter Reset Segmenter
Segment a nonnegative sampled counter at decreases interpreted as reset candidates; resets and wraps cannot be distinguished from values alone.