What Types of Features Are Extracted from CSI Data in Wi-Fi DensePose?
The CSIProcessor class in the ruvnet/wifi-densepose repository extracts six distinct quantitative feature types from Channel State Information (CSI) data: amplitude mean, amplitude variance, phase difference, correlation matrix, Doppler shift, and Power Spectral Density (PSD).
The ruvnet/wifi-densepose project enables dense human pose estimation using standard Wi-Fi signals rather than visual cameras. Understanding exactly what types of features are extracted from CSI data helps developers interpret how raw radio-frequency measurements transform into spatial and temporal descriptors that power downstream detection and pose inference pipelines.
The Six CSI Feature Types
The feature extraction pipeline in v1/src/core/csi_processor.py computes a CSIFeatures dataclass containing six specific descriptor groups. Each feature captures different physical characteristics of the wireless channel between transmitter and receiver.
Amplitude Mean and Variance
The processor calculates first-order statistics from raw amplitude measurements across a time window. Amplitude mean represents the average signal strength for each sub-carrier, computed in lines 69-71 of csi_processor.py. Amplitude variance measures the statistical fluctuation of these amplitudes, indicating environmental stability or motion, extracted in lines 71-73.
These temporal statistics provide baseline signal characteristics that help distinguish between static environments and dynamic human presence.
Phase Difference
Phase difference captures the mean phase offset between adjacent sub-carriers, computed in lines 75-79. This metric reveals phase dynamics caused by multipath propagation and Doppler effects from moving objects. Unlike raw phase measurements, which suffer from random phase offsets, the difference between neighboring sub-carriers remains stable and provides spatial information about reflector locations.
Correlation Matrix
The correlation matrix (lines 81-85) computes pair-wise Pearson correlation coefficients of amplitude across multiple antennas. This spatial feature reveals how signals at different antennas relate to each other, capturing spatial diversity and angle-of-arrival information. High correlation indicates signals arriving from similar directions, while low correlation suggests diverse multipath components.
Doppler Shift
While currently implemented as a placeholder vector (lines 87-90), the Doppler shift feature is reserved for temporal frequency analysis. Future implementations will use temporal history to estimate velocity-induced frequency shifts, providing direct motion velocity measurements from the CSI stream.
Power Spectral Density (PSD)
Power Spectral Density (lines 92-94) transforms the flattened amplitude signal into the frequency domain using Fast Fourier Transform (FFT). This feature reveals the energy distribution across different frequency components, highlighting periodic patterns caused by repetitive motions like breathing or walking cadence.
CSI Feature Extraction Pipeline
The CSIProcessor class orchestrates the transformation from raw radio measurements to structured features through a three-stage pipeline defined in v1/src/core/csi_processor.py.
Preprocessing Stage
Raw CSI data first passes through preprocess_csi_data (lines 14-40), which performs noise removal, windowing, and amplitude normalization. This stage ensures that subsequent feature calculations operate on clean, standardized data regardless of hardware-specific calibration differences.
Feature Extraction Stage
The extract_features method (lines 44-56) invokes six private helper methods, each computing one of the feature types described above. These methods access the preprocessed amplitude and phase tensors to generate the CSIFeatures dataclass instance containing all six descriptor groups.
Downstream Consumption
The resulting CSIFeatures object feeds directly into the human presence detector and PoseService (v1/src/services/pose_service.py), which use the spatial and temporal cues to infer body keypoints without visual cameras.
Practical Implementation Example
The following code demonstrates how to instantiate the processor and extract the six feature types from synthetic CSI data:
import numpy as np
from datetime import datetime, timezone
from src.hardware.csi_extractor import CSIData
from src.core.csi_processor import CSIProcessor
# Build a synthetic CSI sample (in production this comes from the radio)
csi = CSIData(
timestamp=datetime.now(timezone.utc),
amplitude=np.random.rand(4, 30), # 4 antennas × 30 sub-carriers
phase=np.random.rand(4, 30) * 2 * np.pi,
frequency=5.8e9,
bandwidth=20e6,
num_subcarriers=30,
num_antennas=4,
snr=30.0,
metadata={}
)
# Configure the processor (values from example config)
cfg = {
"sampling_rate": 1000,
"window_size": 256,
"overlap": 0.5,
"noise_threshold": -80,
"human_detection_threshold": 0.8,
"smoothing_factor": 0.9,
"max_history_size": 500,
"enable_preprocessing": True,
"enable_feature_extraction": True,
"enable_human_detection": False, # extract features only
}
processor = CSIProcessor(config=cfg)
# Run the pipeline: pre-process then extract
features = processor.extract_features(processor.preprocess_csi_data(csi))
print("Amplitude mean shape:", features.amplitude_mean.shape)
print("Phase diff shape:", features.phase_difference.shape)
print("Correlation matrix shape:", features.correlation_matrix.shape)
print("Doppler vector shape:", features.doppler_shift.shape)
print("PSD shape:", features.power_spectral_density.shape)
Running the snippet prints the shapes of the six feature tensors, confirming that the processor generates the expected descriptors for downstream pose estimation.
Key Source Files for CSI Feature Extraction
Understanding the complete feature extraction architecture requires examining these specific files in the ruvnet/wifi-densepose repository:
v1/src/core/csi_processor.py– Central processing pipeline containingCSIProcessor,CSIFeaturesdataclass, and all six extraction methods (lines 69-94).v1/src/hardware/csi_extractor.py– Defines theCSIDataclass that holds raw amplitude, phase, and metadata fed into the processor.v1/src/services/pose_service.py– Demonstrates real-world consumption ofCSIFeaturesobjects for downstream pose estimation.v1/tests/unit/test_csi_processor_tdd.py– Unit tests verifying each feature extraction method returns arrays of expected shape and type.v1/tests/fixtures/csi_data.py– Synthetic CSI payloads used for testing, illustrating realistic amplitude and phase patterns.
Summary
The ruvnet/wifi-densepose project extracts six distinct feature types from raw Wi-Fi Channel State Information to enable radio-based human pose estimation:
- Amplitude statistics (mean and variance) providing baseline signal strength and stability metrics.
- Phase difference between adjacent sub-carriers capturing multipath dynamics.
- Correlation matrix revealing spatial relationships across multiple antennas.
- Doppler shift placeholder for future velocity estimation using temporal history.
- Power Spectral Density (PSD) exposing frequency-domain energy distribution via FFT.
These features are computed by the CSIProcessor class in v1/src/core/csi_processor.py and consumed by detection and pose estimation services to infer human body keypoints without visual sensors.
Frequently Asked Questions
What is the difference between amplitude mean and amplitude variance in CSI feature extraction?
Amplitude mean calculates the average signal strength across a time window for each sub-carrier, providing a baseline measurement of channel quality. Amplitude variance measures the statistical fluctuation of those amplitudes, indicating environmental stability or motion—higher variance typically suggests dynamic changes in the environment such as human movement. Both are computed in v1/src/core/csi_processor.py (lines 69-73) and provide complementary temporal information about the wireless channel.
How does the phase difference feature help with human pose estimation?
The phase difference feature computes the mean phase offset between adjacent sub-carriers (lines 75-79 in csi_processor.py), which captures multipath propagation dynamics caused by moving objects. Unlike raw phase measurements that suffer from random offsets, differential phase remains stable and provides spatial information about reflector locations. This helps the pose estimation model distinguish between different body positions and orientations based on how they alter the wireless signal's phase characteristics across the frequency spectrum.
Where are the extracted CSI features actually used in the Wi-Fi DensePose system?
The extracted CSIFeatures are consumed by the human presence detector and the PoseService located in v1/src/services/pose_service.py. After the CSIProcessor generates the six feature types, they are passed to these downstream services which use the spatial cues (correlation matrix, phase difference) and temporal cues (amplitude variance, PSD) to infer human body keypoints without requiring visual cameras. The feature extraction pipeline therefore serves as the critical bridge between raw radio signals and AI-driven pose estimation.
What configuration options control the CSI feature extraction process?
The CSIProcessor accepts a configuration dictionary that controls several aspects of feature extraction, including window_size (256 samples by default), overlap (0.5 for 50% window overlap), sampling_rate (1000 Hz), and boolean flags such as enable_feature_extraction and enable_preprocessing. These settings determine the temporal resolution of the amplitude statistics, the frequency resolution of the PSD calculation, and whether specific processing stages are active. The configuration is typically loaded from a YAML file and passed to the CSIProcessor constructor as shown in the implementation example.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →