Wearable heart monitors measure the time between successive heartbeats. Physiologists read that sequence, called heart rate variability (HRV), to estimate how the nervous system is steering the heart. Fast beat-to-beat wobbles reflect the vagus nerve, which acts as the heart's brake. Slower oscillations lasting tens of seconds to minutes reflect blood-pressure reflexes and hormonal control. Two things routinely break the sequence. Motion artifacts knock out contiguous bursts of beats, and occasional abnormal "ectopic" beats insert spurious jumps. Both damage the slow components most. Contiguous gaps cause low-frequency power to be underestimated and high-frequency power to be overestimated (Error Estimation of Ultra-Short Heart Rate Variability Parameters). More than ten ectopic beats in five minutes can distort the standard low-to-high-frequency power ratio by about 500% (Influence of Ectopic Beats on Heart Rate Variability Analysis).
This note proposes treating the repair of such sequences as a receptive-field problem. A receptive field is the stretch of input that one output of a neural network can "see." Our hypothesis is that a network can recover a slow physiological rhythm across a gap only if its receptive field spans the gap plus roughly one period of that rhythm on each side. Ordinary convolutional networks see only a few seconds at a time, which is too little. To test the hypothesis, we train a gap-repairing network whose receptive field we can set exactly. We use oversized one-dimensional convolutions in the style of ParCNetV2, in which the kernel is twice the input length, so a single layer can see the whole recording. We then sweep the receptive field from local to global and measure where errors in standard HRV metrics collapse. The deliverable is twofold. It is a repair method that is judged against strong classical spectral estimators rather than against weak interpolation, and it is a quantitative rule linking the required context length to the frequency band one wants to recover.
Core Claim
Let $g$ be the duration of a contiguous gap in seconds, let $T_b = 1/f_b$ be the longest period in a frequency band $b$, where $f_b$ is the band's lower frequency edge, and let $c$ be a dimensionless constant to be measured. We claim that the repaired estimate of band power in $b$ becomes unbiased only once the model's receptive field $R$, in seconds, satisfies
$$R \gtrsim g + c\,T_b .$$
The form comes from a simple argument. To place a missing oscillation correctly, the model must observe its phase and amplitude on both sides of the gap. For the low-frequency band (0.04–0.15 Hz), $T_b$ is 25 s. For the high-frequency band (0.15–0.40 Hz), it is under 7 s. The very-low-frequency band has periods of minutes.
The claim makes a sharp prediction. Gap repair of high-frequency power should succeed with modest context. Low-frequency power should need around a minute of context for typical motion bursts. Very-low-frequency power should need many minutes, which is beyond what any local convolutional network sees. A second, falsifiable sub-claim is that receptive-field length matters more than the type of operator. A global convolution, a bidirectional state-space recurrence and attention should all show the same threshold once their receptive fields are matched. If that sub-claim fails, the operator itself carries information, and we will report which operator and why.
Relation to Prior Work
Two papers motivate this proposal by measuring the damage without repairing it. The ultra-short-window study (Error Estimation of Ultra-Short HRV Parameters) models motion loss as Gilbert bursts on the MMASH recordings. A Gilbert burst model is a two-state random process that alternates between "good" and "lost" runs. That study shows that RMSSD, the beat-to-beat vagal metric, survives even 70% missing data, whereas SDNN, the overall-variability metric, needs windows longer than two minutes. That pattern is exactly what a context-length account predicts, but the study offers no remedy. The ectopic-beat study responds by designing a metric that ignores the damage, Pt-SampEn, a fixed-tolerance entropy whose change rate stays near 6.6%. We take the opposite route and repair the sequence so that every standard metric, including spectral ones, becomes usable again.
Two papers constrain the design. The cardiac-arrest predictor of Lee et al. shows that hand-built features over independent five-minute windows already reach 0.881 AUROC. Any deep method must therefore earn its place on metric fidelity rather than on downstream accuracy alone. PPGFlowECG synthesizes realistic ECG waveforms from optical pulse signals, but only on clean, synchronized clinical data. That limitation shows that generative realism, which in that work fooled cardiologists at chance level, is not the same as preserving beat-interval statistics. We therefore evaluate repairs by metric error against held-out truth, not by plausibility.
The method comes from the receptive-field literature. We use ParCNetV2's oversized depthwise kernels because they give dense, gap-free global coverage in one layer. That density matters because dilated kernels sample inputs on a sparse grid. Oversized kernels also let us set the receptive field to any exact length by truncating the kernel. Criss-cross attention from CCNet and the axial continuity scans of EccoMamba solve the analogous problem for two-dimensional grids. They would matter only if one worked on time-frequency images, so we treat them as out of scope and keep the problem one-dimensional, which is where the physics lives.
Research Program
The input is a beat-interval series resampled to 4 Hz, paired with a binary mask channel that marks missing or ectopic samples. The network is a stack of oversized depthwise convolution blocks. In each block, the kernel length sets the receptive field $R$, and pointwise mixing layers follow. The network outputs the repaired series. HRV metrics are then computed on the output with the reference implementations in HRnV-Calc, so that the evaluation stays standard and interpretable. In training, the model receives clean long recordings with synthetic damage. Bursts are drawn from a Gilbert model whose parameters are matched to the burst statistics reported for MMASH. Ectopy is simulated as a premature beat followed by a compensatory pause. The loss combines reconstruction error on masked samples with a band-power term. The band-power term penalizes errors in low- and high-frequency power computed differentiably on sliding windows, so that the model is rewarded for the quantities clinicians actually read.
Training uses the NSR RR-interval database, which contains 54 24-hour recordings from healthy subjects, and MMASH, which contains 24-hour beat-interval series from 22 people. We hold out the continuous real-world wearable dataset (A continuous real-world dataset comprising wearable-based heart rate variability alongside sleep diaries) and the CHF database of 29 heart-failure patients entirely. CHF serves as a test of whether the model imposes healthy dynamics on sick hearts. That kind of hallucination is the most serious risk of any learned repair.
The central experiment is a two-dimensional sweep over receptive field $R$, from 4 s to 20 minutes, and gap length $g$, from 5 s to 3 minutes. For each band we fit the threshold surface and estimate $c$. We repeat the sweep with a bidirectional state-space model and a windowed transformer whose context is matched to $R$, to test whether the operator matters.
Baselines
The naive reference point is what practitioners do today. One version discards any five-minute epoch containing a gap or more than a handful of ectopic beats. The other fills gaps by cubic-spline interpolation and computes metrics with Welch's averaged-periodogram method. We report both the metric error and the fraction of recording time that survives. Discarding has zero repair error by construction, but it loses coverage, so the comparison is made at equal coverage. Beating this reference means lower low-frequency and SDNN error than spline filling at the same coverage.
The strongest classical competitors are global by nature. The Lomb-Scargle periodogram estimates spectra directly from unevenly sampled data and never imputes. An autoregressive model fitted on observed samples, with a Kalman smoother filling the gaps, is a linear model whose receptive field is effectively infinite. Both are tuned per recording with their standard hyperparameters: autoregressive order chosen by information criterion, and Lomb-Scargle with the same frequency grid as Welch. Both use the same test segments as our model. They are the competitors that matter most, because they already provide unlimited context. If they match the learned model, the receptive-field story reduces to "use a global estimator," which is still worth knowing.
The strongest learned competitor is a dilated temporal convolutional network trained with an identical damage simulator, loss, data and hyperparameter search budget. Its nominal receptive field is matched to ours, which separates dense from sparse coverage.
For the ectopy-specific comparison, the reference is Pt-SampEn. Its change rate is reported as 6.6% for NSR subjects with more than ten ectopic beats, against 501.2% for the low-to-high-frequency ratio (Influence of Ectopic Beats). Beating it means bringing the repaired ratio's change rate into the same range while also restoring spectral metrics, which Pt-SampEn does not provide.
Two ablations isolate the key ingredient. The first truncates the oversized kernel to local length while holding parameters fixed; this is the receptive-field ablation. The second removes the mask channel. For the downstream task, the reference is the lightweight time-domain HRV pipeline that reports 91.58% AUC-ROC for stress classification on WESAD (Real-World Classification of Student Stress and Fatigue). We found no reported result on Lacuna for learned imputation of beat-interval burst gaps, nor any number for low-frequency bias under bursts, so those baselines are run fresh.
Why not just…?
Why not just use the Lomb-Scargle periodogram and skip repair entirely? This is the most serious threat. Lomb-Scargle handles gaps natively, and for stationary segments with short gaps it may match any learned repair. Its known weakness is that the gap pattern leaks spectral power into neighbouring frequencies, which gets worse as gaps lengthen relative to the band period. It also returns no repaired series, so time-domain metrics and downstream models cannot use its output. The sweep over gap length settles the question directly. If Lomb-Scargle is within noise of our model at every gap length for low- and high-frequency power, we will say so and narrow the contribution to time-domain repair and the measured context threshold.
Why not just fit an autoregressive model and Kalman-smooth the gaps? That approach already has global context, so it directly tests whether learning adds anything beyond linear dynamics. Our expectation is that it fails where autonomic tone shifts within the window, for example during posture changes or stress onset, because a single linear model averages across those regimes. The WESAD stress-onset segments and the held-out CHF recordings are where this expectation either holds or does not.
Why not just use dilated convolutions or a plain transformer? Dilated kernels reach far but sample sparsely. The matched-receptive-field comparison tests whether that sparsity costs metric fidelity on beat intervals. Unlike pixels, these are already a downsampled representation, so gridding may matter less here than it does in vision. The transformer serves as a check on our operator-agnostic sub-claim. If it reaches the same threshold, that supports the claim that context length, not mechanism, is what counts.
Proposed Experiments
The first decisive check is the threshold itself. We expect the receptive-field truncation ablation to keep low-frequency error high until $R$ exceeds roughly $g + 25c$ seconds, and to leave high-frequency error low throughout. If the error-versus-$R$ curves show no knee, or a knee unrelated to band period, the core claim is wrong.
The second check uses real rather than synthetic corruption. WESAD records chest ECG and wrist pulse signals at the same time. We compute HRV from the motion-corrupted wrist signal, with and without repair, and score it against chest-ECG HRV, using per-window absolute error and across-subject correlation for each metric. The across-subject correlation is the guard against hallucination. A model that pulls everyone toward the population mean would show low error but poor correlation.
The third check is transfer to CHF. Here, repaired band powers must preserve the known reduction of variability in heart failure relative to NSR, measured as group-difference effect size before and after repair. Any shrinkage of that difference counts as failure.
Finally, downstream stress classification on WESAD with repaired versus spline-filled HRV features asks whether better metric fidelity translates into accuracy, using the 91.58% AUC-ROC pipeline as the reference. All experiments report errors stratified by gap length and ectopic burden, with subject-level confidence intervals. Hyperparameter budgets are equal across learned models.
References
- Error Estimation of Ultra-Short Heart Rate Variability Parameters: Effect of Missing Data Caused by Motion Artifacts
- Influence of Ectopic Beats on Heart Rate Variability Analysis
- ParCNetV2: Oversized Kernel with Enhanced Attention
- Real-time machine learning model to predict in-hospital cardiac arrest using heart rate variability in ICU
- PPGFlowECG: Latent Rectified Flow with Cross-Modal Encoding for PPG-Guided ECG Generation and Cardiovascular Disease Detection
- CCNet: Criss-Cross Attention for Semantic Segmentation
- EccoMamba: Enhanced Cross-hierarchical Continuity Orthogonal Mamba for Medical Image Segmentation
- HRnV-Calc: A Software for Heart Rate n-Variability and Heart Rate Variability Analysis
- A continuous real-world dataset comprising wearable-based heart rate variability alongside sleep diaries
- Real-World Classification of Student Stress and Fatigue Using Wearable PPG Recordings