01

Lab

Four of my projects as models you can run. Each has a short exercise that says what to try and what you should see, and unit tests behind the mathematics.

Lab 01 · from MYOSA CrashGuard

Crash to call

What CrashGuard is for: a crash becomes an emergency call with nobody touching a phone. The impact is detected, the occupant gets ten seconds to cancel, and if they do not, the system calls a dispatcher, speaks a briefing, and answers follow-up questions using only verified data.

  1. Detect
  2. Warn
  3. Override
  4. Escalate
  5. Locate
  6. Call
  7. Document

ARMED

Monitoring. Press Crash to start the chain.

The transcript appears here.

What the agent is given

The agent can read this record and nothing else. Edit any field and ask again. The occupant, address and hospital are fictional.

Occupant profile
Map lookup
Live crash data
GPS fix32.2830, -106.7480
Peak impactnone yet
Trigger
Ask as the dispatcher

Questions unlock once the dispatcher has answered and the briefing is over.

Try this

  1. Press Crash and leave it alone. Ten seconds later the call goes out with nobody touching a phone. Skip the wait jumps to the end of the countdown.
  2. Press Re-arm, then Crash again, and this time press CANCEL - I'M OK. No call is placed. A false alarm costs one tap.
  3. On a live call, ask Is the occupant conscious? Nothing on the board measures that, so the agent says it does not have that information.
  4. Clear Blood type in the record and ask for it. The answer becomes the same refusal, because the record is all the agent can read. Type a new value and ask again.
  5. Press Pothole. It reads under 2 g, well below the 5.0 g threshold, and nothing happens.
In the real system the call is placed through Twilio and the questions are answered by a Claude agent over a phone line. Neither runs on this page: no call is made and there is no AI here. Answers come from a keyword lookup over the record, written to follow the rule the agent is given, and the wording is illustrative. The peak figure is measured by the detector model described under impact detection.Model: src/lib/sim/dispatch.js · Tests: tests/sim.test.js

Lab 02 · from Synthetic inspection data

Synthetic data generator

A vision model that finds damage needs thousands of labelled images of damage. When those cannot be photographed, they are generated: build the scene in simulation, randomize it, and every image arrives with labels that are exact by construction. This is that workflow at browser scale.

Sample
000001
Craters
0
Light
az 0°, el 0°

The record written beside the image. Boxes are in pixels for a 512 × 512 frame.

Randomize
Overlay

Try this

  1. Press New batch a few times. No two images match, and each one is already labelled.
  2. Untick Ground-truth boxes, then tick it again. No detector drew those boxes. They are read straight off the scene description that produced the pixels, which is why they are exact.
  3. Untick everything under Randomize except Lighting direction. Now the batch is one scene under six suns. A model that has only ever seen one of them fails on the other five.
  4. Click through the batch and read the record under the image. That is what a dataset writer emits per frame, and the sample number alone regenerates the picture.
A teaching model written for this site: a heightfield with Lambertian shading, drawn in your browser. It is not NVIDIA Isaac Sim output, and it contains no data, geometry or parameters from any employer's pipeline.Model: src/lib/sim/sdg.js · Tests: tests/sim.test.js

Lab 03 · from Channel decoding simulations

Syndrome decoder

An error-correcting code adds parity bits so the receiver can find and fix what the channel broke. This is a Hamming(7,4) code, decoded from the syndrome H·rᵀ: first one word by hand, then the same experiment repeated until the error-rate curves appear.

Click a message bit to change the word, or a received bit to flip it in transit.
d1d2d3d4p1p2p3
Messageparity is computed
Sent0000000
Received
Decoded0000000
Parity-check matrix H, and the syndrome s = H·rᵀ over GF(2). A nonzero syndrome equals the column of the bit to flip.
11011000
H1011010s0
01110010

The same experiment, a few hundred thousand times

  • Frame error rate: circles simulated, line exact
  • Bit error rate after decoding: crosses simulated, dashes exact
  • Uncoded: the channel's own error rate
Frames simulated
0
Frame error rate at p = 0.05
0
One word
Monte Carlo sweep

Try this

  1. Click one bit in the Received row. The syndrome stops being 000, it matches one column of H, and that column names the bit to flip back.
  2. Click a second bit. The syndrome still points somewhere, but at a bit that was never wrong. The decoder "fixes" it and hands back a valid codeword that is not the one sent: a frame error.
  3. Press Run the sweep. Every point is that experiment repeated thousands of times at one channel error probability. The simulated points settle onto the exact curves, which is the check that the simulation is right.
  4. Read the left edge of the chart: below p ≈ 0.1 the decoded bit error rate drops under the uncoded line. That gap is what the three parity bits buy.
Hamming(7,4) over a binary symmetric channel is the textbook instance of the method, chosen because every step fits on screen. The research code itself is unpublished and none of it is used here. The exact curves come from enumerating all 128 error patterns.Model: src/lib/sim/hamming.js · Tests: tests/sim.test.js

Lab 04 · from Low-cost EEG electrode capstone

EEG filter bench

Scalp EEG is tens of microvolts, buried under mains hum, slow drift and the wearer's own blinks. A dry electrode makes each of those worse. This bench runs a synthetic channel through the standard cleanup chain so each stage can be switched in and out.

Faint: raw. Solid: after the enabled filters. Spectrum from a 2 s Hann window, averaged.

Alpha, 8 to 12 Hz
0 µV
60 Hz after filters
0 µV
60 Hz at the electrode
0 µV
Filter chain
Subject
Electrode
150 kΩ

Try this

  1. Untick Notch, 60 Hz. The mains line returns in the spectrum and rides on the filtered trace as fuzz.
  2. Drag Contact impedance up and down. Mains pickup follows it in proportion, which is why contact impedance is the first thing the capstone benchmarks.
  3. Press Eyes closed to open them. The alpha peak near 10 Hz collapses. A feature like that, appearing and disappearing, is what a brain-computer interface classifies.
  4. Untick High-pass, 1 Hz: slow drift carries the trace out of its lane. Tick it again and press Blink: a blink sits inside the passband at ten times the signal, so no filter removes it. It has to be detected and rejected.
Synthetic signal, 250 Hz: 1/f background, a 10 Hz alpha rhythm, mains, drift and blinks, with amplitudes chosen for a clear picture. Mains pickup uses the potential-divider model (50 mV common mode, 20% impedance mismatch, 200 MΩ input). No capstone measurement is shown here.Model: src/lib/sim/dsp.js · Tests: tests/sim.test.js
§ How these are built

Models first, pictures second

Each lab is a small pure model with no dependencies, insrc/lib/sim, and a thin canvas layer on top. The models are covered by 64 unit tests that run on every push: a cancel inside the ten-second window means no call is ever placed, the dispatcher model refuses any question its record cannot answer, every single-bit error is corrected and every double-bit error is not, the notch removes 60 Hz and leaves 10 Hz alone.

The canvases stop drawing when they scroll out of view, follow the light and dark themes, and start paused for anyone who has asked their system to reduce motion.