Sample Second Difference Tool
Compute discrete second differences by sample index; not a time-normalized acceleration for irregular timestamps.
Description
Compute discrete second differences by sample index; not a time-normalized acceleration for irregular timestamps.
Second differences compare how adjacent first differences change. They can highlight bends or abrupt local changes in an evenly indexed numeric sequence.
When to use this tool
Compute discrete second differences by sample index; not a time-normalized acceleration for irregular timestamps.
- Prepare the supplied values 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. 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.secondDifferences. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
For every three consecutive values, return value[j+2] minus twice value[j+1] plus value[j]. Preserve the source order; fewer than three values yield an empty list.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| values | values. | List of finite numbers; bounded by the operation |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.secondDifferences | The second differences list in the ordering and representation described above. |
{
"input": {
"values": [
1,
2,
4,
7
]
},
"output": {
"result": {
"secondDifferences": [
1,
1
]
}
}
} Limitations and assumptions
- No timestamps or spacing are supplied. The output is not a time-normalized second derivative and should not be treated as acceleration without the appropriate spacing model.
- 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.