Sample Hold Expander
Evaluate previous-sample hold at explicit query times within the sampled domain; exact sample timestamps use their new value.
Description
Evaluate previous-sample hold at explicit query times within the sampled domain; exact sample timestamps use their new value.
A sample-hold signal retains the most recent observation until another arrives. This is useful when expanding sparse state measurements onto requested timestamps.
When to use this tool
Evaluate previous-sample hold at explicit query times within the sampled domain; exact sample timestamps use their new value.
- Prepare the supplied times, values, queryTimes 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, queryTimes. 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.heldValues. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate aligned values and strictly increasing sample times. For every query within the inclusive first-to-last sample range, choose the value at the latest timestamp no later than that query.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 |
| queryTimes | query times. | List of finite numbers; bounded by the operation |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.heldValues | The held values list in the ordering and representation described above. |
{
"input": {
"times": [
0,
2
],
"values": [
1,
3
],
"queryTimes": [
0,
1,
2
]
},
"output": {
"result": {
"heldValues": [
1,
1,
3
]
}
}
} Limitations and assumptions
- Queries preserve their own input order and need not be sorted. Values are held, not interpolated; queries outside the observed time range are rejected.
- 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
- Sample First Difference Signs
Return signs of adjacent sampled first differences, preserving flat steps as zero.
- Sample Grid Endpoint Count
Count a regular sample grid starting at start, with end inclusion explicit; a nonaligned end is not invented as an extra sample.