The SNUADC rate from the mains hum, where the stamps cannot give it¶
57% of recordings carry no SNUADC stamp correction, so the working reference runs on a borrowed rate. Checked against the BIS through a second, independent path, the stamp model's rate (model5, capped by the recorder's 0.5 s rule) drifts by 9.5 ppm (23 ms/h, median). The mains hum gives each such recording its own rate, 12.0 ppm (29 ms/h): it cut the drift from 31 ppm on the earlier model (model3), but on model5 it only trims the tail.
| Date | 2026-11-11 |
| Status | current |
| Methods | Clocks carried in the signal, One event, two clocks |
| Clocks | SNUADC sample clock, Recorder PC clock, BIS clock |
| Devices | SNUADC, BIS monitor |
| Variables | ECG lead II (SNUADC), Arterial pressure (SNUADC), BIS EEG |
Background¶
Without stamp corrections the stamp model cannot measure the SNUADC's rate, so it borrows one: the typical rate of the recording's setup or SNUADC port, capped since model5 so that the count gains less than the recorder's 0.5 s in any stretch (How the Vital Recorder stamps SNUADC records, tested against the release). The reference drifts by however far the recording's rate is from that. The hum is seen on the SNUADC's own sample count whatever the stamps do.
Data¶
The whole release. Hum lines from Mains hum as an outside clock, and the recording PCs against the grid (2,455 recordings with SNUADC hum, first 60 min); SNUADC and BIS rates from their stamp corrections (How often each device is corrected); BIS-against-ECG burst drift over each whole recording (median 2.2 h) from the burst validation (Shared bursts between the ECG and the EEG). 3,622 of the 6,350 recordings with SNUADC events with SNUADC have no stamp correction; 1,248 of them have hum.
Method¶
- Hum rate: rate = line + g_setup + k. The line is the hum's frequency on the SNUADC count (f_grid − f_SNUADC); g_setup the median PC-against-grid rate of recordings with corrections in the same setup (else the same SNUADC port, else all; at least 10 recordings, leaving out the recording itself); k one constant. In physiosync's convention, so it replaces the assumed rate in physiosync.stamp_clock.
- The constant k is calibrated on 174 recordings with SNUADC corrections whose BIS rate also comes from its own corrections: the burst drift left there against the hum rate minus the measured rate. k = −12.6 ppm.
- Check, on recordings not used for g or k: 223 recordings (224 on model3) without SNUADC corrections, with hum, whose BIS rate comes from the BIS's own corrections. With the BIS on a measured rate, the drift of the BIS-against-ECG burst lag over the recording is the error of the SNUADC rate the stamp model used. It is compared with the error left when the hum rate is used instead.
Results¶
Error of the SNUADC rate against the burst reference, 223 recordings on model5 (11 Nov 2026, $W/hum_snuadc/m5,
recorded run) and 224 on model3 (29 Oct, $W/hum_snuadc/release):
| Rate used | Zero-centred robust SD | Median drift | Recordings drifting more than 0.1 s/h |
|---|---|---|---|
| The stamp model's rate, model5 (setup or port rate, capped at 0.5 s per stretch) | 9.5 ppm | 23 ms/h | 19% |
| The hum rate, on model5 | 12.0 ppm | 29 ms/h | 13% |
| The hum rate with g from whole teeth only, on model5 | 21 ppm | 52 ms/h | 14% |
| The port's assumed rate, model3 (uncapped) | 31 ppm | 76 ms/h | 33% |
| The typical rate of the recording's SNUADC mode, model3 | 19 ppm | 46 ms/h | |
| The hum rate, on model3 | 13 ppm | 31 ms/h | 13% |
- Model5 did most of what the hum route did. The cap (How the Vital Recorder stamps SNUADC records, tested against the release) keeps a borrowed rate inside what the recording's own lack of corrections allows, and that alone takes the drift from 31 to 9.5 ppm (modes "none" 8.6 and "step" 10.1 ppm). The hum rate is unchanged (12.0 ppm) and so no longer narrows the typical drift, but it still cuts the share drifting more than 0.1 s per hour.
- The hum rate follows the burst drift (rank correlation +0.53, model3). Mode "none" recordings ran a median 27 ppm off the model3 rate; the hum sees this. After the hum rate the two modes are alike (11.9 and 12.2 ppm on model5).
- Reference noise: where both rates come from corrections, the burst drift has a robust SD of 2.7 ppm (about its median; 3.0 ppm about zero), so the 12 ppm is the hum rate's own error.
- Not crystal warm-up: the hum line per 30-min block over whole recordings (47 recordings of 4 h or more) is flat; the first hour minus the whole recording is 0.0 ppm (median; IQR −6.5 to +7.9).
- Where the hum adds nothing: on recordings that already have corrections, the measured rate is better (the hum rate differs from it by 16–20 ppm, robust SD): the hum's error is the grid's hour-scale wander and the PCs' spread.
| Parameter | Value | Status | From |
|---|---|---|---|
| Hourly drift of the working reference without stamp corrections | 23 ms/h (n = 223; vitaldb-bench tools/hum_snuadc_rate.py on the burst validation of model5 (recorded run, 11 Nov 2026); 76 ms/h with model3) | measured | The SNUADC rate from the mains hum, where the stamps cannot give it |
| Hourly drift of the working reference with the hum rate | 29 ms/h (n = 223; vitaldb-bench tools/hum_snuadc_rate.py on the burst validation of model5 (recorded run, 11 Nov 2026); 31 ms/h on model3) | measured | The SNUADC rate from the mains hum, where the stamps cannot give it |
| Drift of the working reference with the hum rate | 12.0 ppm (n = 223; vitaldb-bench tools/hum_snuadc_rate.py on the burst validation of model5 (recorded run, 11 Nov 2026); the hum no longer narrows the stamp model's 9.5 ppm, but trims the tail (13% of recordings beyond 0.1 s/h against 19%); 12.8 ppm on model3) | measured | The SNUADC rate from the mains hum, where the stamps cannot give it |
| Drift of the working reference without stamp corrections | 9.5 ppm on the stamp model's rate (23 ms/h median); 12 ppm with the hum rate (29 ms/h) | measured | The SNUADC rate from the mains hum, where the stamps cannot give it |
| Recordings given a hum rate | 1,248 recordings | measured | The SNUADC rate from the mains hum, where the stamps cannot give it |
| Recordings without SNUADC stamp corrections | 3,622 of 6,350 recordings with SNUADC (57%) | measured | The SNUADC rate from the mains hum, where the stamps cannot give it |
Discussion¶
Through the hum, a reference outside the recording (the grid) gives each uncorrected SNUADC recording a rate that a second, independent clock path (the BIS bursts) confirms to 12 ppm. It ties the SNUADC sample clock, the recorder PC and the BIS to the grid at the level of rate.
For the atlas. The working reference's clock domain now states its drift against the recorder PC: 10 ppm in recordings without corrections, as a spread between recordings, and 12 ppm with the hum rate (the domain 'stamp-model time with the hum rate'). Signals synchronised to the reference share its drift, which cancels between them; against signals stamped by the PC it limits how long a window can be. The SNUADC ECG and ART have a form that uses the hum rate; on model5 it is the better choice only for recordings far from the borrowed rate (the tail), not in general.
The constant k. g, pooled over recordings with corrections, depends on how many corrections they carry (+1.6 ppm with one, −13.8 ppm with two or more). That was read as selection by rate; it is mostly a measurement artefact (9 November): with one correction there is no whole tooth, and the SNUADC "rate" in g is a line fitted through a single step, which carries no rate (Mains hum as an outside clock, and the recording PCs against the grid, Recorder PC rate against the grid, recordings with one SNUADC correction (withdrawn), withdrawn). k is calibrated against the BIS bursts, so it absorbs the offset this puts into the pooled g, and the check above measures the hum rate's error as it is; but the one-correction recordings widen each setup's g. Pooling g from recordings with two or more corrections instead removed most of the offset but left a larger spread (18 ppm), from fewer recordings per setup.
Limitations¶
The check needs a BIS with its own corrections: 223 recordings (224 on model3), three quarters in step mode (165), mostly on port COM4. The hum is measured over the first 60 min of a recording and applied to all of it. It gives a rate, not an offset. The drift is stated for recordings without corrections; with corrections there is none to speak of. It does not apply to frequent-correction recordings: the ten with a hum rate say fast (−33 to −117 ppm), where their own steps say slow (How the Vital Recorder stamps SNUADC records, tested against the release).
Open questions¶
- Combine the hum with the capped rate (next step). On model5 the stamp model's capped rate is better typically (9.5 against 12.0 ppm) and the hum better in the tail. Using the hum rate only where it falls outside the cap's range, or weighting the two, may beat both. Pooling g from whole teeth only was tried (11 Nov,
$W/hum_snuadc/m5_teeth, tools/hum_snuadc_rate.py --min-teeth 1) and was worse (21 ppm): too few recordings per setup (318 in all). - The hum over the whole recording (next step). The hum rate uses the first hour. Over the whole recording (the scan's --block-min option) the rate would carry less of the grid's hourly wander.
Code¶
Figures¶