
Code, scripts and data to reproduce every figure and numerical result of the manuscript Preventing and detecting silent EDF corruption in real-time biopotential streaming: a buffer-then-flush writing method and a round-trip integrity test (under review).When real-time acquisition software writes sub-record device blocks straight to an incremental EDF writer, each write commits a full data record padded to length: the resulting EDF+ file is structurally valid yet inflated by the record-to-block ratio, with attenuated RMS amplitude and a distorted power spectrum, and no error is raised. This package characterises the effect across a configuration sweep and across three independent EDF writers (pyedflib, EDFlib-Python, edfio), and provides two remedies: a buffer-then-flush writing pattern that commits only complete records, and a library-independent round-trip integrity test that compares reported duration, RMS amplitude and power spectral density. The failure and its remedy are reproduced on two real surface-EMG recordings acquired with independent hardware chains (a BITalino board and an Arduino-compatible board with a MyoWare 2.0 sensor), included here as de-identified EDF+ files.
