Maximum a posteriori detection of heartbeats from a chest-worn accelerometer

Objective. Unobtrusive long-term monitoring of cardiac parameters is important in a wide variety of clinical applications, such as the assesment of acute illness severity and unobtrusive sleep monitoring. Here we determined the accuracy and robustness of heartbeat detection by an accelerometer worn on the chest. Approach. We performed overnight recordings in 147 individuals (69 female, 78 male) referred to two sleep centers. Two methods for heartbeat detection in the acceleration signal were compared: one previously described approach, based on local periodicity, and a novel extended method incorporating maximum a posteriori estimation and a Markov decision process to approach an optimal solution. Main results. The maximum a posteriori estimation significantly improved performance, with a mean absolute error for the estimation of inter-beat intervals of only 3.5 ms, and 95% limits of agreement of −1.7 to +1.0 beats per minute for heartrate measurement. Performance held during posture changes and was only weakly affected by the presence of sleep disorders and demographic factors. Significance. The new method may enable the use of a chest-worn accelerometer in a variety of applications such as ambulatory sleep staging and in-patient monitoring.


Introduction
The monitoring of cardiac parameters has a variety of applications in medicine.One example is the assessment of acute-illness severity, where heartrate (HR) is measured to compute an early warning score for patient deterioration (Royal College of Physicians 2017).Another is the monitoring of sleep using cardiac parameters, as an alternative to polysomnography (Bakker et al 2021).For these applications, precise measurement of instantaneous heart rate (IHR) is paramount.IHR is derived from heartbeats, specifically the inter-beat intervals (IBIs) and beat localization times; it is computed as the inverse of the IBIs and can change at every heartbeat.A common characteristic of these applications is the need for prolonged monitoring of patients in bed, either continuously or night-after-night, which is why the measurement must be unobtrusive, be robust against differences in wearing conditions and postures and allow for easy re-attachment of the sensor.
The gold standard for cardiac measurements is electrocardiography, or ECG, in which the QRS complexes are the basis of measurement.The R-peaks are used to localize heartbeats and the intervals between R-peaks (R-R intervals) are used to measure IBIs (Clifford et al 2006) .Alternative detection methods have been developed, which may or may not require body contact.Among the contactless methods are millimeter wave radar (Chen et al 2022) and remote photoplethysmography (PPG) (de Haan and Jeanne 2013).An often used method that requires body contact is PPG, where the blood volume pulse is measured by means of a sensor on the finger or on the wrist (Hoog Antink et al 2021).
Another approach is ballistocardiography, which measures cardiac vibrations through the structure upon which the body resides.The vibrations can be measured using sensors installed on the bed, either on top of or below the mattress.In a comparable approach, seismocardiography (SCG), cardiac vibrations are measured on the chest wall.SCG has long been studied (Agress and Fields 1959) and has regained attention since microelectromechanical systems such as accelerometers, have become widely available at low cost (Taebi et al 2019, Rai et al 2021).SCG measurement may performed by means of an accelerometer inside a device worn on the chest, as an adhesive patch or through a band.The advantages of using a chest-worn accelerometer are multiple; modern accelerometers have a small footprint, are relatively low in cost, have low power consumption, and only require mechanical contact with the chest at a single point.There is no need for skin contact, neither electrical nor optical, which means that biocompatibility issues leading to allergy, or skin irritations can be avoided, and skin preparation is not required.These properties make it suitable for prolonged wearing, or nightly reapplication.
Many studies use SCG to investigate cardiac functioning, specifically cardiac time intervals, such as the preejection period and the left ventricular ejection time (Khosrow-Khavar et al 2017, Dehkordi et al 2019).Some studies also look at the IBIs (Wahlström et al 2017, Cocconcelli et al 2020, Centracchio et al 2023, Parlato et al 2023, Milena et al 2023).In one study, 66 participants equipped with an array of 32 IMUs, were measured in supine posture for one minute, and IBIs were computed by means of a Hidden Markov Model (Wahlström et al 2017).Other studies used templates.In one study, 13 participants wore an accelerometer and rested in a chair for four minutes and templates were automatically calibrated for each participant (Cocconcelli et al 2020).In another study, 100 participants wore an accelerometer and a gyroscope and were measured in supine position for 6 min and 48 s in average, after which participant-specific templates were automatically matched (Centracchio et al 2023, Parlato et al 2023).In yet another study, 21 subjects equipped with an IMU were measured for two minutes in supine posture, and heart beats were detected by envelope detection using a Hilbert transformation (Milena et al 2023).
A common characteristic of all these studies is that the recording times were relatively short and that subjects followed a protocol in which they were asked to not move and remain lying in the same posture.However, during protocol-free conditions, such as sleep, subjects are free to move their body and limbs, and take any posture they prefer.A method for estimating the heart rhythm should therefore be robust against these conditions and be accurate at the same time.
Freedom of movement brings additional challenges to the processing of the data.Global template approaches, for example, cannot be used, as the shape of the waveform may change with posture.This problem has been addressed in the past by exploiting local periodicity, rather than global templates (Brüser et al 2013).Local periodicity may be viewed as maximally localized templates, because two neighbor heartbeats are each other's templates.This method was evaluated on ballistocardiography signals, from which it was able to accurately estimate IBIs, but the accuracy of beat localization remained unclear.From literature we know, that, at least in supine posture, the SCG signal is locally periodic (Dehkordi et al 2019), which is why a local periodicity approach may be suitable for SCG as well.
Here, we evaluate the detection of heartbeats from a chest-worn accelerometer.We evaluate a previously suggested approach based on local periodicity (Brüser et al 2013) and we introduce a new method, which extends the previous method with maximum a posteriori estimation (MAP).We compare the two methods on beat localization, IBI estimation, and on the derived metrics IHR and HR.We use overnight sleep recordings from a population that is diverse in gender, body-mass index, age, with various sleep disorders.

Data collection
Data were collected at Sleep Medicine Center Kempenhaeghe, Heeze, the Netherlands, as part of the SOMNIA project (van Gilst et al 2019).Recruitment was done among individuals scheduled for overnight polysomnography as part of the standard diagnostic process.Participants undergoing CPAP titration, with intellectual disabilities, or with an earlier diagnosis of atrial fibrillation or other rhythm disorders were excluded.Next to the polysomnographic montage, the participants wore a prototype chest-worn device including a 3D accelerometer (ADXL355, Analog Devices, Wilmington MA, USA), see figure 1.The device had a cable that was connected to a remote recorder, and staff were instructed to mount the sensor device on the thoracic respiratory belt, such that the cable was at the top right.The raw accelerometer signals (x, y, and z, each sampled at 250 Hz) were recorded in the recorder and were later downloaded into a computer for analysis.ECG was recorded by the PSG system, using a modified lead II montage sampled at 512 Hz.
The SOMNIA study was reviewed by the medical ethical committee of the Maxima Medical Center (Eindhoven, the Netherlands.File no: N16.074).All participants provided consent prior to study initiation.The protocol for data analysis was approved by the Medical Ethical Committee of the Kempenhaeghe hospital and by the Internal Committee of Biomedical Experiments of Philips Research.A total of 147 participants was included (69 female, 78 male), with ages ranging from 17 to 80 years (mean 46.8, SD 15.9).BMI ranged from 18 to 42 kg m −2 (mean 26, SD 4).The three sleep disorders with the highest prevalence among the included individuals were Sleep Disordered Breathing (71), Insomnia (58), and Movement Disorders (31).Recording durations ranged from 6.7 to 9.8 h (mean 8.3, SD 0.5).

Data preprocessing and transformation
Prior to detecting heartbeats, we preprocess the data and transform it into spectral and temporal representations, as is shown in figure 2. First, the three components of the acceleration signal a are summed and bandpass filtered with cutoff points of 3 Hz and 25 Hz, such that a one-dimensional SCG signal s is obtained.The 3 Hz cutoff point is chosen to suppress lower-frequency components such as respiration.The summation reduces the sensitivity for changes in the orientation of the sensor with respect to the heart.Even though the instructions in the study prescribe a fixed orientation, in applications in which the sensor does not have a cable, users may mount the sensor in a different orientation.Especially in free-living applications where users re-apply the sensor nightly, there can be quite some variation.Furthermore, the orientation with respect to the heart may vary within a night due to posture changes and arm movements.Finally, the one-dimensional SCG signal s is used for the spectral and temporal transformations.
Next to the transformations, the SCG signal s is partitioned into segments.A segment is an interval defined by consecutive samples for which | | s s , th  with s th defining a threshold (empirically set to 0.06 g), such that large motion artifacts and posture changes are excluded from segments.Heartbeat detection is only performed within segments.In time intervals external to segments, no heartbeat detection is performed, as motion artifacts mask any heartbeats.An example of partitioning into segments may be found in figure 5(a).
The spectral representation D S has been introduced in Brüser et al (2013) and comprises local periodicity spectra: with spectrum ( ) S j t¢ representing local periodicity as a function of , t¢ around a center time ( ) t j T 1 , m j =with T = 200 ms.The local periodicity expresses the similarity of two intervals from s as a function of the period time , t¢ with one interval ranging from t m j t -¢ to t, and one interval ranging from t m j to t , Due to the prominence of the heartbeats in s, high periodicity typically occurs when t¢ is equal to the time Figure 2. Block diagram of the data processing, with the 3D acceleration signal a, the one-dimensional SCG signal s, the spectrally transformed data D , S the temporally transformed data D , T the likelihood ( | ) P D , q the prior ( ) P , q and the MAP estimation MAP q .
distance between the last heartbeat before t m j and the first heartbeat after t m j (which together constitute an IBI).As a typical IBI is much longer than T, multiple spectra will have their peak at the same .
t¢ When the periodicity over time is plotted on a gray scale, as is shown in figure 4(c), IBIs will become visible as horizontal bars, with height and duration equal the IBI.
The temporal representation D T expresses the locally normalized magnitude of s, with separate components for the positive and negative parts, see figure 4(d).The normalization for each sample n is relative to the maximum of the product of the absolute value of s and a Gaussian window function centered at the sample n, with a standard deviation of 1.7 s (corresponding to an IBI at a heartrate of 35 beats per minute).If we denominate the normalized positive component f p and the normalized negative component f , n then we get:  ( ( ) ( ))

MAP estimation
Core to our method is a latent-variable model.This describes the stochastic relation between observed data D S and D , T and a latent random variable (t , 1 t q = ), describing the heartbeats with the starting time t 1 and the IBIs ( ) , , .
The starting time t 1 is the localization time of the first beat and the IBIs are equal to the difference between the localization times of beats i and i 1: The temporal likelihood is high for data of which the acceleration has a high magnitude at the occurrence of a heartbeat.Therefore, we interpret the locally normalized magnitude (see equation (2)) as the (unnormalized) temporal likelihood: with c T a normalizing constant, t i the localization time of heartbeat i, and f a either f p or f , n depending on whether we choose to localize beats at the positive or negative component of s.The choice for either f p or f n will be described in section C3. Figure 4(d) shows temporally transformed data D T of high likelihood, as the peaks in ( ) f t n coincide with the heartbeats, that are shown as dashed lines in figure 4(e).The spectral likelihood is high for data of which the spectral peaks match with the IBIs, as is the case in figure 4(c), where the dark horizontal bars (the spectral peaks) match in height and duration with the IBIs in figure 4(e).To compute the spectral likelihood, we define D S i as a subset of spectra with their center times within the interval spanned by IBI i: We interpret the geometric mean of the spectral values in D S i as the (unnormalized) spectral likelihood: The mean i m is the geometric mean over the periods p j ¢ with j from ( ) as in equation (9), and s is the standard deviation of the period times p .j 2.3.3.Finding the maximum With (6), (7), and (11), the expression for the MAP estimate t (equation ( 5)) can be rewritten as follows: where the expressions for the factors in the right-hand side are given by equations (7), ( 9), and (11).
As there may be many heartbeats in one recording (typically ~30.000), finding the maximum becomes intractable.Fortunately, the problem can be reformulated into a Markov Decision Process, which breaks down the problem into steps (see supplemental materials).In each step, a current localization time t i is advanced to a next localization time The value ( ) V t i of a localization time t i is the maximum of the sum of rewards that may be obtained from t i onwards: + until all data have been processed.We chose C 3 = and H 8. = The decision process needs a starting point t .
1 To this end, the data are partitioned into segments, in which a segment is an interval in which | | s s , th  with s the SCG signal and s th a threshold (empirically set to 0.06 g).We only process segments with a duration  15 s as in shorter segments the impact of body and sensor settling may be too prominent.For each segment, a starting point t 1 is searched such that ( ) R t , 1 1 t is maximal.This is done for both polarities of the SCG signal, so with f f a p = and f f , = see (7).The polarity (p or n) with the highest reward is then chosen and the decision process commences from t 1 in forward direction as described above, and in reverse direction, in a similar manner, but then with t t .t are compared against a threshold R th and beats that have their reward below the threshold are discarded.The thresholding enables the selection of an operating point; decreasing R th decreases the number of detected beats and increases the mean posterior probability of the remaining beats.

Synchronization and pairing with ECG beats
We compute the localization times for the ECG signal, through the detection of R-peaks, using a nonlinear transformation in combination with first-order Gaussian differentiation (Kathirvel et al 2011).The IBIs are then computed as the time-differences between the localization times and IBIs that exceed a threshold T th are discarded (we chose T th = 1714 ms, corresponding to 35 beats per minute).
Using the localization times of the SCG and ECG beats, we synchronize the two acquisitions, globally and locally.The global synchronization aims at reducing overall clock offset and drift and was performed by minimizing the localization error between all matched ECG and SCG beats within each recording.An ECG beat and SCG beat become a matched pair if they are each other's nearest neighbors in time, and their distance is less than 250 ms.The localization error, with an example shown in figure 5, may be positive or negative, and may exhibit jumps (caused by changes in the SCG signal morphology) and trends (caused mainly by clock drift).Using a manual procedure, the offset and drift of the SCG signal are adapted such that the localization error trends disappeared, and the mean localization error becomes zero (globally).
In addition to the global synchronization, we also performed a local optimization aimed at estimating a lower limit for the localization error.For each segment within a recording, the timing offset of the SCG signal is adjusted starting from the global clock offset, until the mean localization error within the segment becomes zero.No drift adjustment is performed for the local synchronization.

Performance metrics and statistics
For performance on beat detection, localization, and IBI estimation, we synchronize over segments without body motion as well as over full recordings.For both cases, we compute the same performance metrics.First, we label all beats; ECG and SCG beats that are in a pair get the label true positive (TP), ECG beats that are not in a pair get the label false negative (FN), and SCG beats that are not in a pair get the label False Positive (FP).From these labels we compute the metrics sensitivity = TP/(TP + FN) and positive predictive value (PPV) = TP/(TP + FP).To get meaningful Sensitivity and PPV metrics, in case of synchronization over segments, we only consider segments with a duration of at least 5 min.In case of synchronization over full recordings, all processed segments are included and the Sensitivity and PPV are computed over the full recording.
For the TP beats, we further define the IBI error as the difference between the SCG and the ECG IBIs and the localization error as the difference between the SCG and ECG localization times.Finally, we perform factor analysis for the RMSE IBI error.For the numeric factors (BMI and Age), we perform Spearman rank correlation, while we perform a Mann-Whitney U test for the categorical factors (Sex and presence of the three most prevalent disorders in the study).
For performance of HR and IHR, we synchronize over full recordings.For the IHR, for both SCG and ECG, a stepwise constant function is computed, with levels equal to the inverse of the IBIs and level changes at the localization times.The two functions are then resampled to 10 Hz, after which the error is computed as the difference between the two, thereby discarding gaps.For the HR, for both SCG and ECG, we take 15 s intervals over which we compute the HR as the inverse of the average of the IBIs, thereby discarding intervals with less than 5 IBIs.The error is then computed as the difference between the SCG and ECG HR.
As our method comprises the extension of an existing method (Brüser et al 2013) with MAP, we also compute the results for the existing method (without MAP).Furthermore, we tune the operating point of the method with MAP, such that its Sensitivity is close to, but not lower than that of the method without MAP.We compute the statistics for both methods and compare them by means of a Wilcoxon signed-rank test.As we have more than one statistic on the same data, we use a Bonferroni-corrected significance level of /m a (a = 0.001, m = 9) to prevent false discoveries.

Results
The overnight recordings of 147 participants were preprocessed and segmented, and the median coverage was 79.9% (Q1 = 65.7%,Q3 = 86.2%).This coverage is the combined result of segmentation, with median coverage of 96.6% (Q1 = 94.7%,Q3 = 97.6%),and thresholding within each segment, as described in the section on operating point selection.We obtained performance metrics for the methods with and without MAP, see table 1.All errors were significantly lower with MAP than without.The median RMS IBI error decreased by a factor 2.9 from 25.2 to 8.8 ms (the median IBI was 938 ms).The median RMS localization error decreased by a factor 1.3 from 73.2 to 58.1 ms.Although significant, this reduction factor (1.3) is rather limited when compared to the reduction factor for the RMS IBI error (2.9).
Figure 5 shows how the offset in the localization error can change within one recording and explains the limited decrease of the localization error in case of synchronization over full recordings.Figure 6 shows two short intervals, one from a segment before a posture change and another from a segment after it.In the first segment, the method localized on an earlier positive peak in the SCG signal, while it localized to a later negative peak in the second.The difference in localization caused a change in the offset of the localization error, which could not be compensated for when synchronizing over full recordings.Further examples are given in the supplemental materials.
When synchronizing over segments, on the other hand, the offset in the localization error could be compensated for, and the median RMS localization error decreased from 58.1 ms (as in table 1, with MAP) to 7.90 ms (as in table 2, with MAP).This decrease shows that the higher localization error in table 1 was only due to changes in offset and that the MAP method consistently localizes at the same point (phase) in the cardiac cycle.Again, all errors were significantly lower with MAP than without.The IBI localization error decreased by a factor 2.8 from 15.8 to 5.6 ms, while the RMS localization error decreased by a factor 5.6 from 44.6 to 7.9 ms.As only segments longer than 5 min were included in table 2, the coverage was 77.9% (Q1 = 67.0%,Q3 = 84.9%).As the morphology of the SCG signal changes, the beat detection algorithm localizes at two different points in the cardiac cycle:at t = 02:45 it localizes at an early positive peak of the SCG signal, while at t = 03:15 it localizes at a later negative peak.As a result, the localization error jumps from negative to positive.We have found that adding MAP to the detection method significantly improved the performance.Without reducing sensitivity, the RMS IBI error decreased by a factor 2.8, while the RMS localization error decreased by a factor of 5.6.A possible reason for the improvement is the larger scope of the algorithm; when estimating one IBI (in the Markov Decision Process), all data up to 8 IBIs ahead contribute to the choice for that single IBI.
Table 3 compares our results with other studies on seismocardiography, which reported IBI performance.It should be emphasized that a direct benchmark is not possible, since studies used different protocols, and ultimately, different measuring setups, accelerometers and even performance metrics, so this serves merely as a high-level comparison.Our study shows that it is possible to achieve a high level of accuracy in IBI, HR and IHR estimation also on longer recordings, including changes of posture and body movements, achieving errors at least comparable with the best studies reported even if those were obtained in shorter recordings with subjects laying still in fixed postures (mostly supine).
As for the localization error, we found that it was substantially higher when the synchronization was performed over whole recordings (MAE = 45.9 ms, table 1), than over segments without body movements (MAE = 4.7 ms, table 2).The body movements, and perhaps more importantly, posture changes, cause the MAP search algorithm to use different localization points in the cardiac cycle.These cause a change in the offset in the localization error, which is removed by synchronization within a stable posture period.In these intervals, the algorithm consistently assigns localization points to the same point in the cardiac cycle, achieving a relatively small localization error.Note that these intervals were detected by the algorithm itself from the acceleration data, without manual annotations of any kind.
The influence of demographics and sleep disorder prevalence on the performance was limited.Spearman correlation coefficients for age and BMI were only 0.22 and 0.12, while the largest increase in RMS IBI error was due to the occurrence of sleep disordered breathing (from 5.2 to 6.2 ms, +19%), such that still a high level could be maintained.Only a small increase (+9%) in IBI error was found for female over male participants.This shows that the method is robust against body movements and posture changes but also against the presence of sleep disorders and different demographic factors, such as gender.
As stated, the MAP estimation was beneficial for the robustness and accuracy of the method.The probabilistic approach with the latent variable model, Bayes' rule, and the MAP estimation, provided a structured framework for estimation.Separate models could be created for the likelihood and the prior, and the product of the two automatically yielded an objective function.The chain rule of probability allowed for the reformulation of the MAP problem into a Markov Decision Process problem, of which an optimum solution is described by the Bellman equation.The optimum can be approximated by a tree-search algorithm, of which the width and depth can be adjusted to trade accuracy against run time.A limitation of this study is that subjects with prior diagnosis of cardiac rhythm disorders, most notably atrial fibrillation, were excluded from the study.Especially during sleep monitoring, atrial fibrillation is highly prevalent among patients with sleep-disordered breathing (Linz et al 2022).During cardiac arrhythmias, local periodicity, upon which the method relies, may be absent and therefore results may be worse.Future work should include patients with cardiac arrhythmias and annotation of cardiac rhythms should be made, such that performance under such conditions can be investigated.Another limitation is that the computation of the prior was done by inspection of the full recording; we did not investigate the effect of a constrained lookahead, which is required for low-latency applications.Furthermore, the Markov Decision Process may be improved; instead of exhaustive search, dynamic programming or reinforcement learning may be applied.Finally, further research may be conducted in the mapping of the three accelerometer axes into the onedimensional SCG signal.The summation that we used in the present study, reduces sensitivity to changes in the orientation of the sensor with respect to the heart and maintains periodicity, as any linear combination of signals with period T is also periodic with T. However, noise may not be uniformly distributed over the axes, so alternative methods may be evaluated in future work, such as a vector sum which may increase SNR while preserving amplitude periodicity.
The possibility to accurately and robustly estimate HR and IHR, as presented in this paper, together with our earlier published work on respiration (Schipper et al 2021(Schipper et al , 2023)), may enable cardio-respiratory applications to work with a single sensor.The sensor can be small and only needs mechanical attachment at a single point on the chest, without the need for skin contact.One example of such an application is the detection of patient deterioration using respiration rate and HR (Jacobs et al 2021).Another application may be in positional therapy devices for obstructive sleep apnea, which use a chest worn tactile feedback system to entrain the patient to avoid supine sleeping, thereby reducing the apnea burden (Berry et al 2019).The addition of our method may enable the estimation of residual apnea burden, quantified in the form of the apnea-hypopnea index by using IBIs and respiratory effort from an accelerometer in the therapy device itself (Xie et al 2023).
In conclusion, we propose a method that detects heartbeats from a chest-worn accelerometer, demonstrating robustness and high accuracy during overnight recordings with unrestricted postures and body movements, in a diverse population and in the presence of disorders.This enables applications, that directly measure respiration, to monitor cardiac activity robustly and accurately without the need for an additional sensor.

Figure 1 .
Figure 1.(a) Location of the sensor device (S) and ECG electrodes (E) on the chest wall of the female/male participant.(b) The 3D printed device including the accelerometer, measuring 62 × 48 × 14 mm and weighing 30 grams, with the cable at the top-right.

Figure 3 .
Figure 3.The local periodicity spectrum and how it relates to the SCG signal: (a) the SCG signal s, with the interval from t m j to t m j t + ¢ overlayed on the interval from t m j t -¢ to t m j (in dark black), and (b) the local periodicity spectrum, with a peak at t¢= 1130 ms, being the time distance between the high-amplitude vibrations (heartbeats) in the first and second intervals.

Figure 4 .
Figure 4. Waveforms for a full example, from top to bottom: (a) the raw acceleration data D (with arbitrary offsets for x, y and z), (b) the SCG signal s, (c) the spectral representation D S with higher periodicity in darker shades of grey, (d) the temporal representation D T with the positive and negative components ( ( ) f t p and ( ) f t n), (e) the latent variable q with the IBIs , i t horizontal, at a height equal

Figure 5 .
Figure 5. Segments and localization errors.(a) The raw acceleration signals for a full recording.The signals are colored within segments and grayed outside of segments.A total of 70 segments is present with a mean duration of 443 s, covering 97.4% of the recording time.(b) The localization errors for synchronization of SCG and ECG over the whole recording (global sync) and over segments (local sync).The markers A and B are timepoints before and after a change in sleeping posture from left to right, and they are detailed further in figure 6(c).The raw acceleration zoomed in around the posture change between A and B (at t = 03:04:00).

Figure 6 .
Figure 6.ECG, SCG and beat localizations for timepoints A and B from figure 5, after global synchronization (LE = localization error, pos = sleeping posture).The top graphs show the ECG signal with localized R-peaks.The bottom graphs show the SCG signals with localized heartbeats.The dashed arrows show the localization error.As the morphology of the SCG signal changes, the beat detection algorithm localizes at two different points in the cardiac cycle:at t = 02:45 it localizes at an early positive peak of the SCG signal, while at t = 03:15 it localizes at a later negative peak.As a result, the localization error jumps from negative to positive.
.70), are put in a sequence, which is then median filtered (kernel size = 151) to remove outliers.The median-filtered period times, p , t¢) and the period times p j of the t¢ ) are computed.Next, the period times p j of high peaks (v v , j ¢ are put in a new sequence (at their original positions j), and the period times for the positions k for which no sufficiently strong peak was found (v v ¢ ¢ ¼ gives a period time for each time point t , m j which are used for the computation of the prior.The prior is then computed as follows: t , In each step, a reward is obtained, equal to the log of the corresponding factor in (12): i t (Bellman 1952he Bellman equation(Bellman 1952) and provides guidance on decisions for i t such that an optimal solution for equation (12) is found.During each step, the process aims to decide for a value of i For each IBI candidate, equation (14) is evaluated recursively, up to a finite horizon, or recursion depth, H.
i for which it inspects C IBI candidates, being the i t for the C highest peaks in ( ) R t , .i i t i 1

Table 1 .
IBI, localization and detection results when synchronizing over full recordings, pooled over subjects (N = 147).

Table 3 .
Comparison of results against other studies.