One event, two clocks¶
Find an event that two independently clocked signals both record, and read the offset between their clocks from where each puts it.
| Techniques | Windowed cross-correlation, Beat matching, Null controls |
Studies¶
| Study | Date | Status | Summary |
|---|---|---|---|
| The rebuilt PPG slip finder and its correction | 2026-11-13 | current | Fourth of the sawtooth series (Finding and placing each PPG frame slip finds the slips, The PPG sawtooth's period, its phase jumps, and the reversed sawtooth their grid, Where the PPG sawtooth stops where it stops). The slip finder is rebuilt around one rule: correct a step only when the evidence that it is a frame slip is strong, because a wrong correction puts a false step into real physiology. It judges each candidate on the shape of the pulse and, where there is one, on the arterial line, and corrects only one-frame steps. Checked against 172 blinded manual labels, a review of 174 corrections and sawtooths injected into real recordings, it called no held-out slip-free event a slip and 98% of the corrections reviewed were judged right. Its correction was then tested end to end against the arterial line in 2,976 recordings, which showed the first version made a third of them worse; rebuilt so each tooth closes exactly, it brings finger PAT closer to arterial PAT than the earlier method (median spread 9.46 against 11.17 ms in sawtooth recordings, 13.95 uncorrected), though it leaves more recordings worse than uncorrected (7.3% against 2.9%). physiosync 0.3.2, fit_ecg_ppg_delay(method="rebuilt"). |
| The SNUADC rate from the mains hum, where the stamps cannot give it | 2026-11-11 | current | 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. |
| Closing loops in the timing graph | 2026-11-11 | current | Where two independent routes reach the same clock, the offsets around the loop must sum to zero. Three measured loops close within their noise; the BIS loop closes up to a constant latency; the proposed EMR loop is not a loop at all. Adjusted as a network over the whole release, every loop type closes on average, including two that reach the SNUADC through the PC-stamped Solar8000 numerics instead of its own stamps. |
| How the Primus AWP is stamped, and which breath the lag locks onto | 2026-11-11 | current | The Primus airway-pressure stamps are an anchor plus a sample count; the anchor holds across the regular pauses and is reset, with an error of up to about ±2 s, at irregular gaps. Separately, about a quarter to a third of the stretches in the release-wide breath matching were measured a whole breath off, which inflated the apparent per-recording offset. Each stretch's breath is now set from pauses in ventilation or a rule, and the breath error that remains is stated on its own. Most of the AWP's lead over the breath is real on the recorder's timeline, bounded by the PC-stamped PIP numerics. |
| Shared bursts between the ECG and the EEG | 2026-11-11 | current | Electrocautery and muscle bursts appear in both the SNUADC ECG and the BIS EEG. Cross-correlating their envelopes gives the offset between the two devices' stamps every 10 minutes: about −0.8 s, in a sawtooth that follows both clocks' corrections. |
| The Primus ventilator against SNUADC, by breaths | 2026-11-11 | current | Each breath shows in the Primus airway pressure and, through the chest, in SNUADC's central venous pressure. Tracking that lag puts the Primus on the SNUADC timeline to about 55 ms over the whole release, with a line per stretch between its AWP pauses (49 ms in the pilot). At scale it measures the Primus drifting a median +105 ppm against the recorder PC between its AWP pauses, with steps at the pauses that do not reset it. |
| The stamp sawtooth model for SNUADC and BIS | 2026-11-09 | current | Fitting each track's record stamps against its sample count as a drift with corrections (a sawtooth) puts SNUADC and BIS on one timeline without any artefact. Checked against shared bursts, the EEG–ECG timing error falls from about 790 ms on the recorded stamps to 33 ms with one constant per SNUADC mode in the pilot, and 40 ms over the whole release. |
| Paced beats in the BIS EEG | 2026-10-28 | current | In the six paced recordings with BIS, the EEG averaged around paced beats shows beat-locked activity beyond every random-time control in some 3-minute windows, and in two recordings a sharp deflection that repeats exactly at the pacing period. Whether pacing artefact or the heart's own trace, it could time the BIS against SNUADC to a few ms. |
| The heartbeat in the Primus airway signals | 2026-10-19 | current | A pilot in 30 recordings for a heartbeat-locked route from the Primus to the SNUADC. Airway pressure shows the heartbeat in 10% of windows only. CO₂ shows a heartbeat-locked trace in 61% of windows, tight to 19 ms, but its lag does not follow the Primus drift, so it cannot time the Primus. Closed as a clock route. |
| The Primus stamp step at each airway-pressure pause | 2026-10-19 | current | Measured directly at 2,488 pauses in 1,021 recordings: where CO₂ carries on through the AWP pause (74%), the Primus stamps barely step (median 0 ms, p10–p90 −164 to +188 ms, close to the no-pause controls); where CO₂ stops too (26%), they step by up to seconds. No step undoes the drift built up since the last pause. |
| The SNUADC clock through the Solar8000 numerics, whole release | 2026-10-19 | current | On the SNUADC's own sample count, the delay from the waveform to the PC-stamped Solar8000 heart rate and mean arterial pressure ramps at the SNUADC's drift against the PC, measured without its stamps or resets. In recordings with whole reset intervals it agrees with them from 6 h (median difference per recording +1.7 ppm, 333 recordings; +7.8 ppm over all 582, with the shorter ones biased). It is too noisy per recording, and in recordings under 6 h its rate is biased toward zero; from 6 h it is unbiased against the resets and joins the clock network as an edge (Closing loops in the timing graph). |
| SNUADC against the PC-stamped heart rate | 2026-10-17 | superseded | A 66-recording pilot of the route from the SNUADC clock to the recorder PC through the PC-stamped Solar8000 heart rate, superseded by the whole-release The SNUADC clock through the Solar8000 numerics, whole release. Its pooled rates were aggregated by a step that was not saved and do not reproduce from the saved per-recording output; they are kept as history, not for use. |
| Drug effects as a clock check | 2026-10-13 | current | Infusion pumps, the rapid infuser and the cerebral oximeter share no waveform with the reference. Drug effects that follow infusions at plausible delays (propofol to BIS in about 2 minutes, fluid to CVP in about 30 s) bound their clocks to well within a minute of the recorder. |
| Rare devices against SNUADC | 2026-10-13 | current | CardioQ, EV1000, Vigileo and Vigilance each get a link to the SNUADC timeline: beat matching for the CardioQ, mean arterial pressure alignment for the EV1000 and Vigileo, and a long-window fit for Vigilance's averaged heart rate. |
| The cardiac artefact in the BIS EEG | 2026-10-12 | current | The BIS EEG carries a weak electrical trace of every heartbeat. Too weak for beat-by-beat matching, it shows clearly when averaged on the ECG's R peaks, and gives a second SNUADC–BIS timing reference that agrees with the bursts to about 16 ms. |
| Arterial pressure as a check on the PPG correction | 2026-10-11 | current | Arterial pressure is sampled by the same converter but has no frame and no sawtooth, so every PPG slip leaves ECG→ABP unchanged. Against it, detected slips are 97–100% real and tier A leaves about 2 ms of drift mid-tooth. |
Observations from these studies¶
| Observation | Status | Summary |
|---|---|---|
| About 20 ms of signal lost at every SNUADC reset | established | At each step-mode reset the acquisition pauses for about 20 ms inside the last record before the new timing, and that time is never sampled: about 19 ms on the sample count (17.3–20.3 ms; Signal lost at a SNUADC step-mode correction), about 2 ms more once the filler sample is counted. Every record still holds 100 samples, so nothing in the file shows it. |
| Long SNUADC recordings with no correction at all | established | 1,066 cases of 2.5 h or longer, outside the frequent-correction mode, show no 0.49 s SNUADC correction (988 none at all, 78 a single small step), although at the step-mode median of −63 ppm a 0.49 s step falls due within about 2.2 h. Explained by the Vital Recorder's rules: a fast converter is reset only once its count is 0.5 s ahead of the PC, and a new segment restarts the count, so a slower fast unit, or one whose segments are short, never reaches it. 81.8% of the 1,238 with a hum rate sit inside the window the rules allow, and 98.5% within the hum's noise (How the Vital Recorder stamps SNUADC records, tested against the release). There is no third mode. |
| SNUADC sends no time; the recorder stamps by count | established | The SNUADC board streams samples with no time stamps. Every SNUADC time in VitalDB is the recorder's model of the board's clock: the sample count at the nominal rate, pulled back when it drifts too far. |
| The ECG→PPG delay is a sawtooth | established | Inside the oximeter the PPG content creeps 18–52 ppm against its 30 Hz frames; every 11–31 minutes the delay steps up by one 33 ms frame (no repeated frame shows in the waveform). The rate is fixed per recording setup. |
| The EEG–ECG offset is fixed by the SNUADC correction mode | established | After the stamp model, BIS EEG stamps still sit early against the SNUADC ECG by a constant (EEG minus ECG): −805 ms in step mode and −665 ms in frequent-correction mode over the whole release, tight within a port or unit. The mode, a property of the setup, sets the constant. |
| The EMR clock's offset cannot be separated from documentation lag | established | Both routes between the EMR clock and the recorder run through the case start, so any EMR clock offset cancels. Without a time from outside the release it is confounded with how late entries are made. |
| The EVENT track repeats the clinical table | established | In 411 random cases the recorder EVENT track's four entries equal the clinical table's case start, operation start, operation end and case end exactly: the release generated them from the table. |
| The Primus AWP stops for about 21 s every 7,230 s | established | In 5,502 recordings the Primus airway-pressure waveform has gaps of 19–23.5 s (whole messages of 0.48 s, mostly 21.12 s) that recur every 7,230 s, the Primus's correction interval; a clock correction follows about 21.6 s after. The CO₂ waveform carries on through 90% of them (74% of the pauses measurable for the step below). The 21 s of AWP are lost, not merely re-stamped. |
| The BIS EEG carries an averaged cardiac artefact | likely | Averaged on the ECG's R peaks, the BIS EEG shows the heartbeat (median 4.3 µV), near-simultaneous with the R wave. Single beats are too weak to match one by one. |
| A heartbeat-locked trace in the CO₂ waveform that ignores the Primus clock | open | Averaged on the ECG's R peaks, the Primus CO₂ waveform shows a heartbeat-locked signal in 60% of 10-minute windows (30-recording pilot), tight to about 20 ms. Unlike the breath, its lag does not drift with the Primus clock: it stays fixed on the SNUADC timeline. |
The approach¶
The idea. Stamps say how a device drifts against the recorder, not where its time sits against another device. For that, both devices must see the same event: an electrical burst reaching ECG and EEG electrodes at once, a breath moving airway pressure and venous pressure, a heartbeat in two monitors' pressure traces, a drug's effect following its infusion.
What it gives. The offset between two devices' stamps, followed through a recording: its constant part (a latency), its ramps (the difference of the two drifts) and its steps (corrections). Where a third route exists, the offsets must close around the loop, which tests every assumption on the way.
How. Turn each signal into something the event dominates (a band-power envelope, breath onsets, beat times); cross-correlate in sliding windows, or match events one to one with a delay window around the expected level; keep only windows with a clear, unique peak; repeat everything at random times as a control.
Pitfalls. Regular events (ventilation, steady heart rhythm) match one cycle away almost as well as at the right lag. Physiology adds its own delay: a breath reaches the veins later than the airway, so the offset mixes clock and body. Soft links such as drug onset only bound an offset, they do not measure it.
Techniques¶
- Windowed cross-correlation: Cross-correlate two signals' envelopes in sliding windows (for example 10 minutes, stepped by 5) to follow an offset that changes over a recording, keeping only windows whose peak is clear.
- Beat matching: Pair beats seen by two signals one to one, using a delay window around the known level rather than nearest neighbours, which flip between beats when the lag is near half a beat.
- Null controls: Repeat each test where the effect cannot be: at random times, at the same interval later, sign-flipped, or between two channels of one device. The effect is real only where it beats its control.