WiFi CSI signal-processing guide

WiFi CSI Feature Extraction: From Raw Signals to Reliable Features

WiFi CSI feature extraction is the bridge between a packet capture and a model that can be tested. This practical guide shows how to separate amplitude and phase, clean noisy samples, create windows, build compact features, and keep every assumption visible for RuView-style experiments.

CSI amplitude and phase traces flowing into compact feature statistics for Wi-Fi sensing
The feature pipeline condenses signal behavior into documented values for comparison and validation.

WiFi CSI feature extraction turns a stream of complex channel measurements into numbers that describe change over time, across subcarriers, or between antenna pairs. The goal is not to make a graph look smooth. The goal is to preserve task-relevant variation while recording which filters, calibrations, windows, and labels produced it.

A useful pipeline keeps raw CSI, cleaned CSI, and derived features as separate artifacts. That separation makes it possible to compare a simple amplitude baseline with a phase-aware representation, find leakage caused by room changes, and reproduce a result after the router, board, or firmware is updated. The same discipline helps connect ESP32 capture, public datasets, and RuView-style signal interpretation without treating a visualization as a verified camera or medical reading.

WiFi CSI feature extraction: what changes in the data?

A CSI record usually contains a complex value for each subcarrier and antenna pair at a packet timestamp. From that value, a pipeline can derive magnitude (often called amplitude) and phase. Amplitude is often the easier first signal because it is stable enough for a baseline, while phase can contain finer path information but also carries offsets from clock and carrier synchronization. Neither channel is automatically a human feature.

Feature extraction adds a useful boundary after capture. Packet parsing answers whether a record is valid. Preprocessing reduces known receiver or environment artifacts. Windowing turns a sequence into a comparable sample. Feature extraction then summarizes that window for a rule, classifier, regressor, or visualization. Naming those boundaries prevents a model score from hiding an untracked transformation.

  • Keep packet timestamps, subcarrier indices, antenna labels, channel, bandwidth, and firmware beside each sample.
  • Treat amplitude, raw phase, calibrated phase, and engineered features as different data products.
  • Write the intended task first: presence, motion, gesture, position, or a continuous signal estimate.
  • Do not call a feature a measurement of a person until a reference label and validation protocol support that claim.

The four-stage CSI preprocessing pipeline

A small, explicit pipeline is easier to debug than a large notebook full of hidden transforms. Start by rejecting malformed records and aligning timestamps. Clean amplitude and phase with methods that match the receiver errors you can actually observe. Next, choose a fixed window length and stride. Finally, calculate features and store the parameters used for every split.

The order matters. Filtering before timestamp alignment can hide packet gaps; fitting a scaler on the complete dataset can leak information from the test set; and calculating a phase feature before calibration can turn hardware drift into a false activity signal. The workflow image below is a compact checklist, not a universal recipe. Use the simplest path that answers the first experiment.

Four-stage WiFi CSI workflow from packets to CSI, features, and validation
A reproducible path keeps packet checks, signal cleaning, feature calculation, and validation visibly separate.
Stage Input Output to save Typical failure
Validate Raw packet records Accepted rows, gaps, metadata Malformed or duplicated samples
Clean Amplitude and phase streams Filter settings and calibrated arrays Removing the signal with the noise
Window Ordered samples Window length, stride, labels Windows that cross an event boundary
Extract One fixed window Feature vector and schema Features with inconsistent scale

Amplitude features: start with a stable baseline

Amplitude features are often the safest first baseline because they avoid some of the ambiguity of raw phase. For each selected subcarrier or antenna pair, record a center, spread, range, percentile, or temporal difference. A median or Hampel-style filter can reduce isolated spikes; a low-pass or Savitzky–Golay filter can reduce high-frequency variation when its cutoff is justified by the sampling rate and task.

Do not smooth until the signal becomes convenient. A filter can erase a short gesture, delay an event, or make packet loss look like a gradual movement. Save the unfiltered amplitude, the filtered version, and the parameter values. Compare an empty-room baseline, one controlled event, and a negative control such as a door or fan so that a change in amplitude is not automatically attributed to a person.

  • Summarize per-subcarrier amplitude with mean, variance, RMS, dynamic range, and robust percentiles when useful.
  • Use a median or Hampel filter for isolated outliers, and document the window size and threshold.
  • Compare several subcarriers rather than trusting the noisiest or largest one.
  • Keep the original samples so a feature can be traced back to the capture.

Phase features: unwrap, calibrate, then decide

CSI phase is periodic, so a jump across the -pi to pi boundary can look like a large movement even when the underlying path changed smoothly. Phase unwrapping removes that artificial wrap. Receiver timing and carrier-frequency offsets can still create a slope or offset across subcarriers, so a calibration step or a CSI-ratio method may be needed before phase is used as a feature.

The important choice is not whether phase is always better. It is whether the phase quality, calibration, and test conditions support the feature you want. The research literature shows that amplitude-only, phase-only, and amplitude-plus-phase representations have different noise and compute trade-offs. Begin with an amplitude baseline, add calibrated phase as a controlled comparison, and report the extra preprocessing cost instead of assuming a fused representation will generalize.

  • Check phase continuity and unwrap only after confirming subcarrier ordering.
  • Record the calibration method, antenna pair, reference subcarrier, and discarded edge carriers.
  • Compare phase features on a held-out session because hardware drift can dominate the result.
  • Avoid health, identity, or security claims based on phase features without domain-specific validation.

Windowing, normalization, and feature vectors

A model rarely consumes one packet. A window groups a fixed number of samples or a fixed time interval so that temporal behavior can be summarized consistently. Choose the interval from the task: a short motion event needs a different window than slow occupancy or breathing research. Store the stride and the label rule, including what happens when an event starts or ends inside a window.

Normalization should be fitted on training data and then applied unchanged to validation and test data. Per-session normalization can hide real deployment drift, while global normalization can allow one room to influence another. Keep both the raw feature schema and the fitted parameters. A compact vector may be easier to inspect than a large image-like tensor, but it can also discard the fine time-frequency pattern a deep model needs.

Feature family Examples Useful question Caution
Amplitude statistics Mean, RMS, variance, range, percentiles How much did the channel magnitude change? Gain drift and outliers can dominate
Phase and coherence Unwrapped phase spread, phase difference, coherence Did path-related phase stay consistent? Offsets and antenna pairing matter
Temporal features Slope, peaks, zero crossings, autocorrelation What changed inside the window? Sampling gaps distort timing
Spectral features Band power, peak frequency, centroid, bandwidth Which motion or breathing band is active? Frequency claims need a stable sample rate

A compact feature vector for RuView-style experiments

A practical feature vector can combine amplitude statistics, phase consistency, and a power-spectral-density summary. The RuView training code describes fields such as amplitude peak, RMS, dynamic range, phase coherence, total power, peak frequency, centroid, and bandwidth. Treat this as a versioned schema example, not a requirement to use exactly twelve numbers. Define each field, axis, scale, and missing-value policy before training.

  • Name every feature, axis, unit or normalization, and source window.
  • Return finite values for empty or degenerate windows and log the reason.
  • Compare a compact vector against a raw tensor so compression does not hide a useful signal.

Validate the feature pipeline before training a larger model

Test the feature pipeline on a fixed recording, a repeated movement, an empty room, a packet-loss segment, and one changed condition. Inspect missing values, window counts, and feature ranges before fitting a model. Hold out complete sessions, days, people, rooms, or node placements when the claim should generalize; adjacent random windows can leak near-duplicates across the split.

  • Run a deterministic replay and compare the feature vector hash or numeric tolerance.
  • Measure packet loss, timestamp gaps, channel changes, and out-of-range values.
  • Freeze normalization and feature selection before evaluating the held-out split.
  • Record false positives caused by doors, fans, pets, furniture, or ordinary network traffic.
WiFi sensing validation sequence from radio traces to features, held-out samples, and a result matrix
A feature pipeline needs a protected test condition and an error view, not only a successful training plot.

Technical references

WiFi CSI feature extraction FAQ

What is WiFi CSI feature extraction?

It is the step that converts cleaned CSI windows into measurable values such as amplitude statistics, phase coherence, temporal changes, or spectral power. The feature schema and preprocessing settings should be recorded so the result can be reproduced.

Should I use CSI amplitude or phase first?

Start with amplitude as a transparent baseline, then add calibrated phase as a controlled comparison. Phase can contain useful path information, but unwrap and calibration errors can create features that do not generalize.

How long should a CSI feature window be?

Choose a window that matches the event you need to measure and record its length and stride. Short gestures, occupancy, and breathing-scale signals need different time spans. Test the choice on held-out sessions rather than selecting it from one attractive plot.

Do I need to filter CSI before feature extraction?

Often you need some cleaning, but there is no universal filter. Compare an unfiltered baseline with a documented median, Hampel, low-pass, or other method and check whether it removes the target event along with receiver noise.

Can CSI features identify a person or diagnose health?

A feature vector is not proof of identity or medical status. Those claims require separate datasets, reference measurements, risk controls, privacy review, and domain-specific validation. Treat RuView-style output as experimental signal interpretation unless stronger evidence exists.