All projects

PCA Framework

Embedded device authentication, from-scratch numerics in C

Role
Developer / Researcher · Independent research
Tags
Embedded · ML · Research

4–5×

faster device flow (27–40 min → 6.5–10 min)

2001

data points per frequency sweep

Problem

Authenticate physical devices from their frequency-sweep signatures — on the device itself. The reference pipeline was Python on a tethered PC, and a full five-sweep authentication took 27–40 minutes.

Approach

Rewrite the numerics in portable float32 C: a public C API over custom kernels and a cyclic Jacobi eigensolver, using a dual-covariance PCA formulation to keep the eigendecomposition tractable at 2001 points per sweep. Then profile the real bottleneck — the physical sweep, not the math — and batch Bridge transfers while tuning sweep frequencies.

What I built

  • Custom cyclic Jacobi eigensolver implemented natively in C — no external libraries — with deterministic sign normalization to mirror scikit-learn behavior.
  • Dual-covariance PCA formulation so the eigendecomposition scales with sample count rather than feature count; heap allocation to move past a 256-feature limit and handle 2001 points per sweep.
  • Full C port of the original Python pipeline: loads CSV sweeps, builds single- and multi-sweep PCA identifiers, runs authentication, and emits diagnostic CSVs plus a Markdown report.
  • Standalone Arduino Q architecture — the MCU side runs the frequency sweep and sensor measurements; the Linux side collects data over the Bridge and runs the C PCA pipeline. No tethered PC.
  • Python exporter generates simulated test vectors into a C header, validating the C pipeline's accuracy against known data.

Result

The full device flow dropped from 27–40 minutes to 6.5–10 minutes (~4–5× faster), running standalone on Arduino Q with no tethered PC — sweeps per ~2 minutes instead of 5–8 — with C results validated against scikit-learn.

Media

The PCA Framework measurement circuit built on a breadboard