Encode and Recover Timestamps with Delta of Delta
Encode and Recover Timestamps with Delta of Delta
Try Press Step to uncover the first two timestamp gaps and find the 10 second interval the encoder keeps.
Can you recover the original timestamps?
Time-series codingStart with a recorded timestamp
Recorded timestamp source
Use the chosen clock source throughout. Keep its units and timestamp quality with the record.
Recorded timestamps and their preceding gaps
Start with a known timestamp. Each neighboring pair of stored timestamps has a gap.
Start · known timestamp
- Timestamp
Interval covered
Change covered
- Timestamp
Interval covered
Change covered
Find the initial intervals
Recorded timestamp source
Use the chosen clock source throughout. Keep its units and timestamp quality with the record.
Recorded timestamps and their preceding gaps
Start · known timestamp
- Start + 10 s
10 s
Change covered
- Start + 20 s
10 s
Change covered
Encoder keeps
Subtract each timestamp from the one after it to find the interval. Keep the first interval so the decoder can get started.
StartFirst interval · 10 s
Encode the cadence change
Recorded timestamp source
Use the chosen clock source throughout. Keep its units and timestamp quality with the record.
Recorded timestamps and their preceding gaps
Start · known timestamp
- Start + 10 s
10 s
Seed · keep first interval
- Start + 20 s
10 s
10 − 10 = 0 s
- Start + 32 s
12 s
12 − 10 = +2 s
Encoder keeps
Equal intervals produce zero. A gap that grows from ten to twelve seconds produces a positive two-second change.
StartFirst interval · 10 sSigned changes · 0, +2 s
Encode the return to cadence
Recorded timestamp source
Use the chosen clock source throughout. Keep its units and timestamp quality with the record.
Recorded timestamps and their preceding gaps
Start · known timestamp
- Start + 10 s
10 s
Seed · keep first interval
- Start + 20 s
10 s
10 − 10 = 0 s
- Start + 32 s
12 s
12 − 10 = +2 s
- Start + 42 s
10 s
10 − 12 = −2 s
- Start + 52 s
10 s
10 − 10 = 0 s
Encoder keeps
The return to cadence produces a negative change. Equal intervals produce zero again.
StartFirst interval · 10 sSigned changes · 0, +2, −2, 0 s
Recover the intervals
Recorded timestamp source
Use the chosen clock source throughout. Keep its units and timestamp quality with the record.
Encoder keeps
StartFirst interval · 10 sSigned changes · 0, +2, −2, 0 s
Reconstructed intervals · seconds
| Stored change | Add to prior interval |
|---|---|
| First interval | Seed 10 |
| 0 | 10 + 0 = 10 |
| +2 | 10 + (+2) = 12 |
| −2 | 12 + (−2) = 10 |
| 0 | 10 + 0 = 10 |
Original timeline covered while decoding.
Recover each interval by adding the stored signed change to the interval recovered just before it.Recover and compare timestamps
Recorded timestamp source
Use the chosen clock source throughout. Keep its units and timestamp quality with the record.
Exact matches · offsets from Start
Add each recovered gap to the timestamp before it. Every offset matches its original recorded mark.
| Original mark | Reconstructed mark | Offset addition · seconds |
|---|---|---|
| Start | Start | Start at 0 s |
| Start + 10 s | Start + 10 s | 0 + 10 = 10 |
| Start + 20 s | Start + 20 s | 10 + 10 = 20 |
| Start + 32 s | Start + 32 s | 20 + 12 = 32 |
| Start + 42 s | Start + 42 s | 32 + 10 = 42 |
| Start + 52 s | Start + 52 s | 42 + 10 = 52 |
Start with a known timestamp. Each neighboring pair of stored timestamps has a gap.
Observe The interval panels reveal a 12 second gap after a 10 second gap, add +2 to Signed changes, then add −2 when the next gap returns to 10 seconds.
Explain The decoder adds +2 to the preceding 10 second interval to recover 12 seconds, then adds that interval to the previous timestamp to recover Start + 32 s.
Technical boundaries. The worked example starts from a known timestamp and uses one chosen clock source throughout. Its panels show interval arithmetic and exact matches in seconds. The clock source’s units and timestamp quality stay with the record.