# GL-MT6000 CSI chain health audit

This package audits per-chain presence and amplitude stability in two public GL-MT6000 captures:
the 10-minute dataset and the 60-second browser-demo source.

It answers a narrow question:

> In a reported 2 Tx x 4 Rx / 8-chain capture, are all eight chains present equally, and can
> RSSI, SNR or a simple amplitude statistic choose the "best" chain?

It does not claim to identify the physically best antenna or prove a sensing accuracy.

## Input

- Dataset DOI: <https://doi.org/10.5281/zenodo.23434789>
- Public de-identified capture SHA-256:
  `527466ceb8b5f835e55ff348f02808736b947db39e7baac1f34e375de146a440`
- Capture duration: 599.925 s
- Closed groups: 7,609
- Complete groups: 7,608
- 60-second comparison SHA-256:
  `41c35d9d23e5c03ddd34ae97617e772fecdb55e8545156181828b060605a87a6`
- 60-second comparison: 347 groups, all containing eight chains

The raw capture uses this container:

```text
<float64 timestamp> <uint16 payload-length> <payload>
```

The 24-byte payload header and `chain_info` bit-15 grouping rule are implemented explicitly
in the script.

## Files

| File | Purpose |
| :--- | :--- |
| `analyze_csi_chain_health.py` | NumPy and standard-library analysis plus dependency-free SVG figure |
| `summary.json` | Capture counts, per-chain metrics, method and limitations |
| `chain_metrics.csv` | One row for each tx/rx chain |
| `chain_comparison.csv` | Per-chain ranks and deltas between the two captures |
| `SHA256SUMS` | Checksums for the script, README, summary and CSVs |
| `../../../img/csi-chain-health.svg` | Two-panel figure used by the bilingual article |

## Run

Python 3.9+ and NumPy are sufficient:

```bash
python3 analyze_csi_chain_health.py csi-10m.anon.bin \
  --compare-capture csi_demo_60s_anonymized.bin \
  --summary summary.json \
  --csv chain_metrics.csv \
  --comparison-csv chain_comparison.csv \
  --img csi-chain-health.svg
```

Expected key output:

```text
closed_groups: 7609
complete_groups: 7608
eight_chain_groups: 6714
four_chain_groups: 895
comparison: groups=347 eight_chain=347 four_chain=0 amplitude_r=-0.415472 cv_r=-0.225449
```

## Results

### Capture structure

- 6,714 of 7,609 closed groups contain all eight tx/rx records.
- 895 groups (11.762%) contain only the four `tx0` records.
- 7,608 groups contain only complete 256-subcarrier, non-zero-I/Q records.
- One unfinished record remains after the final closed group and is not used.

### Metadata

Within every closed group, RSSI and SNR are identical across all chain records. Their median is
-31 dBm and 53 dB respectively. They describe the shared reception context; they cannot rank
individual tx/rx chains.

### Chain metrics

The table reports median group mean amplitude and temporal coefficient of variation (CV). Amplitude
is an arbitrary CSI scale, not a calibrated receiver power.

| Chain | Group presence | Median mean amplitude | Temporal CV |
| :--- | ---: | ---: | ---: |
| `tx0/rx0` | 7,609 | 945.632 | 0.149077 |
| `tx0/rx1` | 7,609 | 1,346.556 | 0.104246 |
| `tx0/rx2` | 7,609 | 1,000.199 | 0.191578 |
| `tx0/rx3` | 7,609 | 716.449 | 0.273735 |
| `tx1/rx0` | 6,714 | 313.300 | 0.622773 |
| `tx1/rx1` | 6,714 | 502.511 | 0.396518 |
| `tx1/rx2` | 6,714 | 1,147.028 | 0.172088 |
| `tx1/rx3` | 6,714 | 1,099.939 | 0.143339 |

### Cross-session replication

The 60-second capture has a different structure:

- all 347 closed groups contain eight chains;
- the strongest median-amplitude chain is `tx1/rx1`, not `tx0/rx1`;
- the lowest temporal-CV chain is `tx0/rx0`, not `tx0/rx1`;
- the correlation of per-chain median amplitude between captures is **-0.415472**;
- the correlation of per-chain temporal CV is **-0.225449**.

Amplitude rank changes therefore do not describe a stable hardware ordering. Even two captures
from the same router and home reverse several ranks. `tx1/rx0` moves from amplitude rank 8 in the
10-minute capture to rank 2 in the 60-second capture.

## Interpretation boundary

The safest conclusion is:

1. Preserve chain identity and gate incomplete groups explicitly.
2. Do not use shared RSSI/SNR fields to choose among chains.
3. Do not call low temporal CV "best" without a noise-only baseline and task ground truth.
4. Do not carry a chain ranking from one session into another without revalidation.
5. Compare chains by downstream task performance, calibration and cross-session stability.

It is possible that a low-variance chain is quiet, insensitive or heavily attenuated. It is also
possible that a high-variance chain contains useful motion signal. This capture alone cannot
separate those cases.

## Limitations

- No controlled noise-only baseline or human-event ground truth is present.
- The two captures cover one room, one client and different traffic/session conditions.
- CSI amplitude depends on automatic gain control and the radio/firmware path.
- Chain ordering is hardware- and firmware-specific, not a calibrated antenna coordinate.
- No breathing, fall, occupancy or identity result is inferred.

## License

- Analysis script: MIT.
- Derived JSON, CSV, README and figure: CC BY 4.0.
- Source CSI capture: CC BY 4.0 through the Zenodo DOI above.
