Measurement guide

WiFi Sensing Latency Measurement: Measure the Full CSI Pipeline

Define the event you care about, timestamp each CSI processing stage with one monotonic clock, and report the latency distribution with its setup and limits.

Editorial timeline from WiFi CSI capture through windowing, feature extraction, inference, and a sensing decision
Measure from a stated start event to a stated decision event; stage markers help locate delay without counting it twice.

WiFi sensing latency measurement answers a different question from accuracy testing: how long does a defined sensing event take to become an available decision? A useful result starts with two named events, such as the arrival of the first CSI sample in a window and the emission of that window's decision. Without those boundaries, a number called “latency” may mix radio acquisition, buffering, window formation, feature work, inference, and a remote response.

This guide gives a repeatable way to instrument the path, compare offline replay with live capture, summarize tail delay, and identify the slow stage. It is a measurement procedure, not a RuView benchmark or a universal real-time threshold. Keep the event log and setup details with every reported result.

WiFi sensing latency measurement: define the clock first

Choose the user or experiment event before adding timers. For an application pipeline, a practical end-to-end boundary is often CSI callback entry for the first sample assigned to a window through the moment the corresponding decision is made available to its consumer. If the question is model cost alone, measure inference start to inference completion and label that narrower interval. Do not describe model time as end-to-end delay.

Separate signal age from processing delay. A window may wait to accumulate enough samples before feature extraction even begins. That waiting time can dominate the result while the model itself runs quickly. State whether the start marks the first sample, the completed window, or a request submitted to a service. The same numeric interval can mean very different things when its start and stop events change.

  • Name the start event and the decision event in the report.
  • Say whether acquisition and window accumulation are included.
  • Keep model-only timing separate from the full sensing response.

Separate capture, windowing, features, inference, and response

Instrument the pipeline at transitions that have a stable meaning: CSI callback, queue entry and exit, window ready, feature vector ready, inference start and end, and decision emitted. A capture callback may only enqueue work; timing the callback body alone can miss a backed-up queue. Record a sequence or window identifier at each marker so timestamps from different samples are not accidentally combined.

Calculate each stage from its own start and end markers, then calculate end-to-end delay directly from the outer boundary. Do not add stage durations that overlap or subtract values collected from unrelated windows. In an asynchronous path, queue wait is a stage of its own. If a remote service is involved, separate transport and server time only when both clocks can be compared reliably.

Five WiFi sensing latency stages: CSI capture, windowing, feature extraction, inference, and decision
Use one window identifier to connect every timestamp in the processing path.
Stage Start marker End marker What it can reveal
Capture handoff Callback entry Sample queued Callback work and handoff cost
Queue and window First sample or queue entry Window ready Accumulation and backlog delay
Feature extraction Window accepted Feature vector ready Filtering and transformation cost
Inference Model call begins Model output ready Model execution time
Decision delivery Output ready Consumer receives decision Formatting, transport, and dispatch delay

Choose a clock and record a stable event

Use a monotonic clock for elapsed-time measurements. It should not jump when wall time is corrected, and its resolution must be fine enough for the stages you intend to compare. Record the clock API and units in the experiment notes. Use the same clock for markers on one device; do not subtract timestamps from a sensor board and a server unless you have a documented synchronization method and its uncertainty.

Add only the instrumentation needed to mark transitions. Keep timestamp calls close to the event they describe, and test whether logging or serial output changes the workload. A ring buffer or compact event record can reduce observer overhead. Measure an empty or minimal marker path when practical, but report it as instrumentation context rather than silently subtracting an assumed correction from every sample.

  • Record device, firmware, clock source, resolution, and units.
  • Use a shared window ID and monotonic timestamp for every event.
  • Keep host and device timestamps in separate domains unless synchronized.
  • Note logging overhead and any clock conversion.

Run a repeatable CSI latency measurement

Begin with offline replay so the same captured windows can pass through the processing path more than once. This isolates feature and inference work from radio variation and helps validate event pairing. Then repeat the protocol with live capture, because packet arrival, queueing, and window completion are part of a deployed path. Keep the start and end definitions identical when comparing the two modes.

Warm the device and model in a documented way before collecting the samples that will be summarized. Run enough windows to expose ordinary variation and occasional stalls; save the raw event records rather than only a chart. During each run, preserve the channel, bandwidth, packet settings, window length, overlap, firmware, model version, CPU configuration, and relevant device load. Change one condition at a time when diagnosing a difference.

The output of the run should include paired timestamps for each window, stage durations, missing-event counts, packet or window drops, and a run manifest. Reject incomplete pairs with a recorded reason instead of quietly treating them as fast or slow observations. Repeat the run after a material firmware, channel, window, or model change.

  • Validate pairing and instrumentation with replay first.
  • Repeat under live capture using the same event boundary.
  • Save raw logs, configuration, warm-up policy, and exclusion reasons.

Report p50, p95, p99, jitter, and dropped samples

Report the number of valid windows and a latency distribution, not only an average. The median describes a typical observation; p95 and p99 show how slow the tail becomes under the recorded conditions. State the percentile convention and whether values are calculated per window, per batch, or per session. With a small sample, high percentiles are unstable, so show the sample count and avoid implying precision the run cannot support.

Report stage distributions beside end-to-end delay. A quiet median with a long tail can indicate bursty queueing, operating-system scheduling, radio gaps, or occasional expensive work. Include dropped samples and incomplete windows in the same report because excluding them can make a pipeline look faster while making it less useful. There is no universal latency cutoff for every sensing task; the acceptable response depends on the application and its decision cadence.

Report item Why it matters
p50, p95, and p99 Show typical and tail response under the stated run conditions
Sample and session count Make the stability of the reported percentiles visible
Dropped or incomplete windows Expose missing work that could bias latency downward
Stage timing and end-to-end timing Show where delay accumulates without hiding the outer boundary

Diagnose a slow or irregular sensing pipeline

Use the stage trace to form a testable hypothesis. A growing gap before window-ready points toward sample accumulation, a queue, or packet delivery. A stable window time followed by a slow feature stage points toward preprocessing or memory movement. A long inference interval suggests model execution or contention, while a long gap after inference points toward output handling or transport. Change one suspected factor and rerun the same boundary rather than optimizing from a single aggregate number.

Check for clock mismatches, event IDs reused across windows, missing markers, and logging that blocks the capture path before trusting an anomaly. Compare replay and live capture to separate compute from acquisition effects. If the application spans devices, report the local stages independently until clock synchronization error is bounded. The stage-by-stage method is also useful on constrained hardware: published ESP32 CSI work reports feature and inference costs separately, illustrating why hardware, model, and pipeline context belong beside the result.

Observed pattern First check
Delay rises before a window is ready Window policy, packet gaps, queue depth, and sample rate
Feature time varies between runs Input size, allocation, filtering, and device load
Inference tail grows under load Model configuration, CPU contention, and thermal or power state
Decision arrives late after inference Serialization, task scheduling, network, and consumer queue

Example: make a latency result reproducible

A useful report can be short if it preserves the context needed to repeat it. For example, label a small timing table as an illustrative format rather than a RuView benchmark: one row for callback-to-window, one for feature extraction, one for inference, and one for the full callback-to-decision interval. Put the sample count, p50/p95/p99, drop count, and run configuration beside those values. Never present invented example numbers as measurements of a board or product.

Keep the event log, capture reference, code revision, firmware, hardware placement, channel, window settings, model, clock source, and exclusion rules together. The result should let another researcher recreate the same event boundary and discover where a disagreement begins. Re-run after a material change and retain both reports; replacing old results without their conditions makes trend comparisons unreliable.

Field Example entry
Boundary First CSI sample assigned to a window → decision emitted
Timing method One monotonic clock; raw event log retained
Summary p50 / p95 / p99 per stage and end-to-end; no universal target claimed
Context Board, firmware, channel, window, model, load, and run date
Quality Valid windows, dropped samples, incomplete pairs, and exclusions

Sources and further reading

WiFi sensing latency measurement FAQ

What should count as end-to-end WiFi sensing latency?

Choose the event that begins the user-relevant path and the point where its decision becomes available. A common application boundary is the first CSI sample assigned to a window through delivery of that window's decision. State explicitly whether radio acquisition, window accumulation, network transport, and display are included.

Should latency be measured offline or during live capture?

Use both for different questions. Offline replay helps repeat the same input and isolate preprocessing or inference. Live capture includes packet arrival, queueing, and window formation. Keep the event boundary and processing settings aligned when comparing them.

Why report p95 or p99 instead of only an average?

An average can hide occasional stalls that matter to a responsive application. Percentiles show parts of the observed tail, while the sample count and session details show how much confidence to place in them. Small runs do not support precise tail claims.

Can timestamps from an ESP32 and a server be subtracted directly?

No. Their clocks can have different offsets, rates, and correction behavior. Use a documented synchronization method with bounded error, or report device-local stages separately and measure a boundary on one clock.

Does low latency mean a WiFi sensing model is accurate?

No. Response delay and prediction quality are separate measurements. Evaluate accuracy with held-out sessions, labels, negative cases, and the metrics that fit the task; report latency alongside that evidence rather than as a substitute.