Skip to main content

Crate labstream_time

Crate labstream_time 

Source
Expand description

Timestamp post-processing for LSL. SPEC.md 8.5.

Three stages run in a fixed order: clock sync, then jitter removal, then monotonic clamping (src/time_postprocessor.cpp:60-105).

§Float discipline

The jitter filter is a recursive least squares fit. Every operation here keeps the order of the C++ source, because a different order gives a different result in the last bits.

Three rules hold for every line of the filter:

  1. Do not reassociate an expression to make it read better.
  2. Do not use mul_add, because the source uses a separate multiply and add.
  3. Keep the integer baseline subtraction.

liblsl builds with plain IEEE semantics, and no fast-math flag appears in its build configuration. Bit-exact agreement is therefore a target. It is not a promise across every platform.

Modules§

flags
The post-processing stages, as a bit set.

Structs§

Dejitterer
The recursive least squares filter that removes jitter.
FixedSource
A source with values that a test sets by hand.
PostProcessor
Applies the three stages to every timestamp. SPEC.md 8.5.

Constants§

DEFAULT_SMOOTHING_HALFTIME
The default half-time of the jitter filter, in seconds.
MIN_CLOCKSYNC_INTERVAL
The shortest time between two clock offset queries, in seconds.
SAMPLES_BETWEEN_CLOCKSYNCS
How many samples pass between two clock offset queries.

Traits§

OffsetSource
Reads the clock offset that the time sync channel measured.