WiFi Channel State Information (CSI): OFDM Subcarrier Phase & Fresnel Zone Sensing
Ollama Modal Top-10 Feature #7: WiFi CSI Through-Wall Motion Tracking · Category: Wireless RF Sensing & OFDM DSP · Paired 3D Simulation: Scene 130
Learn how IEEE 802.11n/ac/ax OFDM channel estimators measure amplitude and phase across 52–256 subcarriers, and how elliptical Fresnel zones turn ambient WiFi packets into motion and respiration sensors.
Governing Physical Equation: H(f_k, t) = |H(f_k, t)|·e^{j∠H(f_k, t)}, r_1 + r_2 - d = n · (λ / 2) (n-th Fresnel Ellipsoid)
5-Stage Theoretical & DSP Curriculum
- Stage 2: Elliptical Fresnel Zones Around the TX–RX Line of Sight
Concentric prolate ellipsoids with foci at the WiFi transmitter and receiver satisfy r_1 + r_2 - d = n·(λ/2). The first Fresnel radius at the midpoint is R_1 = (1/2)√(λ·d). When a reflector moves across successive Fresnel zone boundaries (each λ/2 = 2.9 cm at 5.2 GHz), the reflected wave alternates between constructive (+peak) and destructive (-trough) interference.
R_n = (1/2) · √( n · λ · d ) (at 5.2 GHz, d = 4 m ⇒ R_1 = 24.0 cm) - Stage 3: Canceling CFO & SFO Phase Drift via Antenna Conjugate Ratio
Unsynchronized WiFi oscillators introduce random Carrier Frequency Offset (CFO) and Sampling Frequency Offset (SFO) phase noise φ_noise(t) across packets. However, two RX antennas on the same NIC share the exact same clock. Computing the CSI conjugate product H_1(f_k, t)·H_2*(f_k, t) or ratio H_1/H_2 cancels common-mode oscillator phase noise while preserving target Doppler phase.
Q_{1,2}(f_k, t) = H_1(f_k, t) / H_2(f_k, t) (cancels e^{j φ_CFO(t)}) - Stage 4: Hampel Outlier Removal, PCA & 0.15–0.5 Hz Respiration Bandpass
Apply a sliding Hampel median filter to strip packet-burst glitches, project the 56 subcarriers onto their 1st Principal Component (PCA), and apply a 4th-order Butterworth bandpass (0.15–0.50 Hz for breathing, 0.8–2.0 Hz for walking). Combines the highest-SNR subcarriers coherently to resolve 5 mm chest motion when the subject is stationary.
y_PCA(t) = u_1^T · H_norm(t), BPM = 60 · f_peak - Stage 5: Practical Limitations & Multi-Person Interference
Because WiFi wavelengths (5.8 cm at 5.2 GHz, 12.5 cm at 2.4 GHz) and omnidirectional antennas have wide spatial footprints, any second moving person, pet, or oscillating fan inside the room scrambles the single-link Fresnel phase. Understanding this physical limitation prevents overestimating what commodity WiFi routers can resolve in cluttered real-world homes.
Spatial Resolution Δθ ≈ λ / (N_ant · d_ant) ≈ 30°–45° for 3-antenna consumer APs
Reference Implementation — wifi_csi_fresnel_lab.py (Python 3 (NumPy Fresnel Zone & Conjugate CSI Phase Ratio))
import numpy as np
def fresnel_mid_radius_m(freq_ghz: float, dist_m: float, n: int = 1) -> float:
"""Computes the n-th Fresnel zone radius (m) at the midpoint of a TX-RX link."""
wavelength_m = 0.299792458 / freq_ghz
return float(0.5 * np.sqrt(n * wavelength_m * dist_m))
def csi_conjugate_respiration(csi_ant1: np.ndarray, csi_ant2: np.ndarray, fs_pkt: float = 100.0) -> float:
"""
csi_ant1, csi_ant2: shape (T_packets,) complex64 with shared random CFO phase noise.
Cancels CFO via conjugate multiplication and estimates respiration BPM via FFT.
"""
clean_iq = csi_ant1 * np.conj(csi_ant2)
phase = np.unwrap(np.angle(clean_iq))
phase -= np.mean(phase)
freqs = np.fft.rfftfreq(len(phase), d=1.0 / fs_pkt)
spec = np.abs(np.fft.rfft(phase * np.hanning(len(phase))))
# Search in physiological breathing band [0.15 Hz, 0.50 Hz] (9 to 30 BPM)
mask = (freqs >= 0.15) & (freqs <= 0.50)
peak_hz = float(freqs[mask][np.argmax(spec[mask])])
return round(peak_hz * 60.0, 1)
if __name__ == "__main__":
t = np.arange(2000) / 100.0 # 20 seconds @ 100 packets/sec
cfo_noise = np.random.uniform(-np.pi, np.pi, size=len(t))
breath_phase = 0.45 * np.sin(2 * np.pi * 0.25 * t) # 0.25 Hz = 15.0 BPM
h1 = (1.0 + 0.3 * np.exp(1j * breath_phase)) * np.exp(1j * cfo_noise)
h2 = 1.0 * np.exp(1j * cfo_noise)
print(f"5.2 GHz 1st Fresnel Mid-Radius (4m link): {fresnel_mid_radius_m(5.2, 4.0)*100:.1f} cm")
print(f"Recovered Respiration Rate (CFO canceled): {csi_conjugate_respiration(h1, h2)} BPM")
Calibrated Laboratory Hardware BOM
- 2× ESP32-S3 DevKitC-1 Microcontrollers ($12) — 2.4 GHz 802.11n 64-Subcarrier CSI Callback at 100 Hz. Role: Low-Cost TX + RX CSI Research Pair
- Intel AX210 / 5300 NIC or Nexmon Raspberry Pi ($45) — 5 GHz 80 MHz BW (256 OFDM Subcarriers), 2×2 MIMO. Role: High-Resolution Conjugate-Phase CSI Capture
Defensive Countermeasures & Lab Verification
- Fine-grained WiFi CSI extraction requires custom firmware (ESP32-CSI-Tool, Nexmon, or PicoScenes) running directly on one of the WiFi endpoints; standard uncompromised home routers do not expose raw per-packet CSI matrices over the internet.
- Reducing WiFi TX power to the minimum required for indoor coverage and disabling unused 2.4/5 GHz guest beacons minimizes external SNR.
Frequently Asked Questions
Can any standard WiFi router extract CSI without special firmware?
In standard consumer operation, the OFDM channel matrix H(f_k) is used internally inside the baseband WiFi chip to equalize packets and is discarded immediately. Extracting raw CSI to user-space software requires research firmware or debug drivers (such as ESP32-CSI, Nexmon, or PicoScenes).
Why is conjugate multiplication between two antennas required for WiFi phase sensing?
Because the transmitter and receiver do not share a wired clock cable, their local oscillators drift by kilohertz (CFO), adding a huge random phase offset to every packet. Multiplying Antenna 1 by the complex conjugate of Antenna 2 on the same receiver subtracts that shared clock phase identically.
What is the difference between WiFi CSI sensing and 60/77 GHz FMCW radar?
WiFi uses 6–12.5 cm wavelengths and wide omnidirectional patterns (coarse spatial resolution, easily disrupted by multiple moving people), whereas 60–77 GHz FMCW radar uses 3.9–5 mm wavelengths and 4 GHz chirp bandwidths to isolate 3.75 cm range bins.
Peer-Reviewed Citations
- Ma, Y.; Zhou, G.; Wang, S. (2019). WiFi Sensing with Channel State Information: A Survey. ACM Computing Surveys (CSUR), 52(3). Finding: Comprehensive mathematical survey of 802.11 OFDM CSI extraction, Fresnel zone models, and phase sanitization.
- Wang, H. et al. (2016). Human Respiration Detection with Commodity Wifi Devices: Do User Location and Body Orientation Matter?. ACM UbiComp 2016. Finding: Introduced the Fresnel zone reflection model for through-wall WiFi respiration sensing.
More Educational Guides
If any of this frightens you: this site documents what signal physics makes possible in a laboratory, which is not evidence about what is happening to any individual. If you feel watched, targeted or unsafe, that distress is real and treatable. Read about paranoia, mental health and how to get help, or call a free 24/7 line — 988 in the US and Canada, 116 123 in the UK and Norway, 13 11 14 in Australia, or find your country at findahelpline.com.