# CSI subcarrier redundancy and effective-dimensionality audit

This package asks a narrow question about the public GL-MT6000 captures:

> Do 256 reported CSI amplitude bins behave like 256 independent dimensions?

It does not map the array index to a physical frequency, antenna position or
802.11 resource unit. It also does not provide respiration, fall, occupancy or
identity ground truth.

## Inputs

The script expects two Capture v1 container files:

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

The public de-identified inputs are:

| Capture | Rows used | Input SHA-256 |
| :--- | ---: | :--- |
| 10-minute primary | 7,608 | `527466ceb8b5f835e55ff348f02808736b947db39e7baac1f34e375de146a440` |
| 60-second comparison | 347 | `41c35d9d23e5c03ddd34ae97617e772fecdb55e8545156181828b060605a87a6` |

The 10-minute file is distributed through Zenodo:
<https://doi.org/10.5281/zenodo.23434789>. The 60-second file is available from
the project's dataset page:
<https://okwujun.pw/en/datasets/>.

## Method

1. Walk every outer record and close a measurement group when `chain_info` bit
   15 is set.
2. Select `tx0/rx0` only. A missing or duplicate fixed chain is counted and the
   group is not silently replaced with another chain.
3. Keep complete, non-zero 256-bin amplitude vectors.
4. Divide each vector by its own median so a shared gain change does not
   dominate the comparison.
5. Centre and scale each subcarrier over time, then compute the 256 x 256
   Pearson correlation matrix.
6. Eigendecompose that correlation matrix. Report the first component count
   reaching 90%, 95% and 99% cumulative variance, plus the participation-ratio
   effective rank.

This is an amplitude-only, correlation-based audit. High correlation may come
from the radio front end, shared gain, multipath, the capture format or other
joint causes. Correlation alone does not establish causality.

## Reproduce

```bash
python3 analyze_csi_subcarrier_redundancy.py \
  csi_udp_20261010_10m.anon.bin \
  csi_demo_60s_anonymized.bin \
  --out-dir . \
  --img csi-subcarrier-redundancy.svg
```

Only Python 3.9+ and NumPy are required.

## Results

On the 10-minute correlation matrix:

- 6 components explain 90% of the variance;
- 9 components explain 95%;
- 20 components explain 99%;
- the participation-ratio effective rank is 4.568732;
- the first component explains 33.933% and the first 10 explain 96.858%;
- the median absolute off-diagonal correlation is 0.204452;
- 17.451% of pairs have `|r| >= 0.75`, while 10.064% have `|r| >= 0.9`;
- the median adjacent-bin correlation is 0.900779.

The distribution is not one uniform correlation block. A low median does not
contradict the low PCA dimension: the eigenspectrum is dominated by a smaller
number of strongly structured directions.

The normalized median amplitude profile correlates at 0.954781 between the two
captures, and the per-subcarrier temporal-CV profile correlates at 0.984305.
That is evidence of stable structure across these two sessions, not proof that
the same number of components will hold on another router, room or firmware.

## Outputs

- `summary.json`: machine-readable capture, correlation, PCA and limitation data;
- `subcarrier_metrics.csv`: one row for each of the 256 array indices;
- `pca_variance.csv`: all 256 eigenvalues and cumulative variance;
- `SHA256SUMS`: integrity checks for the script, README and generated analysis files.

The public article with methods, figures and limits is:

- Chinese: <https://okwujun.pw/zh/csi-subcarrier-redundancy/>
- English: <https://okwujun.pw/en/csi-subcarrier-redundancy/>

## Evidence boundaries

- The two inputs come from one GL-MT6000, one client, one home, one bandwidth
  and similar firmware.
- The subcarrier index is not treated as a physical frequency.
- There is no noise-only baseline or human-event label.
- PCA variance depends on row normalization and per-subcarrier standardization;
  the published script and data are required for any alternative comparison.
- These results support feature-redundancy checks and dimension reporting. They
  do not prove breathing, fall, occupancy, identity or medical capability.
