Resampling Strategies and their Influence on Heart Rate Variability Features in Low Sampling Rate Electrocardiogram Data

: Heart rate variability (HRV) is a parameter to measure fluctuations in the interval between heartbeats. HRV provides essential insights into the cardiovascular function and autonomic nervous system. Electrocardiograms (ECG) on wearable devices are often recorded at low sampling rates, limiting temporal resolution and information. Resampling is a technique of changing the sampling rate from a high sampling rate to a lower sampling rate and vice versa. This research aims to evaluate the effect of resampling ECG data with a low sampling rate on HRV features. ECG data consists of 50 Hz and 100 Hz sampling rates. Data with a 50 Hz sampling rate is up-sampled up to 100 Hz, while 100 Hz data is down-sampled up to 50 Hz and up-sampled up to 250 Hz using the Fast Fourier Transform Interpolation Method. Upsampling from 50 Hz to 100 Hz shows unsatisfactory results, except for some HRV features such as NN20, pNN20, and CVI. Better results were found when up sampling from 100 Hz up to 250 Hz, with some HRV features showing good concordance values. However, downsampling from 100 Hz up to 50 Hz is unsuitable for HRV feature analysis. To obtain accurate HRV analysis results in all domains, it is highly recommended to use a sampling rate above 100 Hz


Introduction
An electrocardiogram (ECG) is a vital tool in the medical world that is used to record the heart's electrical activity.ECG represents electrical signals produced by contraction and relaxation of the heart muscle.Processing ECG data has many clinical features that can be extracted, including heart rate variability (HRV).HRV measures fluctuations in the interval between heartbeats in-depth and is an essential indicator in analyzing cardiovascular function and the condition of the autonomic nervous system [1,2].
ECG recording is usually carried out using modern equipment that has a high sampling rate.However, nowadays, ECG recording can be done by using a portable device.These mobile ECGs often record data with a low sampling rate, due to data storage efficiency considerations [3,4].As a result, ECG data with low sampling rates have limited temporal resolution and may contain missing information [5].A low sampling rate in HRV analysis can affect the extraction of HRV features and the interpretation of analysis results [6].
Resampling is a method used to overcome challenges in ECG data with a low sampling rate.This technique involves changing the data sampling rate through upsampling or downsampling.Although data resampling has been applied in various signal processing domains [7], the implications of this method for HRV analysis of ECG data with low sampling rates still need to be clarified.
Previous research was conducted by Kwon et al. [8] and Mahdiani et al. [9].Both studies used down-sampling techniques to investigate whether ECG data with high sampling rates (1,000 Hz and 5 kHz) could be reduced.The down-sampling results are explained by keeping the information contained in the HRV feature the same.Data with a high sampling rate can only be obtained from devices with unique technology.Based on this, this research intends to use ECG data with a low sampling rate that could be obtained with wearable devices, and then up-sampling is carried out in stages.
The main aim of this study was to investigate the impact of data resampling on HRV features using ECG data with a low sampling rate.This research will analyze how data resampling affects the extraction results of HRV features and the interpretation of the analysis results.Through the results of this analysis, we hope that it can provide an understanding of when and how this method can be used effectively in the context of cardiovascular analysis.sampling rate [12] as a baseline.Data with a 50 Hz sampling rate will be up-sampled into 60 Hz, 70 Hz, 80 Hz, 90 Hz, and 100 Hz.For data with a 100 Hz sampling rate as the baseline, two resampling processes will be carried out: upsampling up to 250 Hz and downsampling up to 50 Hz (multiples of 10).

Fast Fourier Transform Interpolation
The fast fourier transform (FFT) interpolation method for resampling data is an approach that leverages the frequency-domain concept to alter the data's sampling rate.The interpolation method with FFT works by transforming the original signal into the frequency domain using FFT, changing the sampling rate by a specific factor, and finally converting the signal back to the time domain using the inverse FFT (IFFT).The goal is to obtain new data with a different sampling rate from the original data.Steps of FFT-based interpolation are FFT transformation, adding zero frequencies (zero padding), IFFT, and resampling result.

FFT transformation
First, perform the FFT transformation of the original data to convert it into the frequency domain.The general FFT formula is shown in (1).
where X(k) is the frequency coefficient in the frequency domain, x(n) is a data point in the time domain, k is the frequency index, and N is the data length.

Adding zero frequencies (zero padding)
Increasing the sampling rate can be done by adding zero values to the frequency coefficients in the frequency domain according to the desired frequency enhancement factor.

Inverse FFT (IFFT)
After adding the necessary zero frequencies, perform the inverse FFT to return the data to the time domain.The IFFT formula can be seen in (2).
where x(n) is the resampled data in the time domain, and X(k) is the altered frequency coefficient from the original data.

Resampling result
The data obtained after IFFT is the resampled data with the altered frequency as needed.

Peak Detection and RR-Interval
This research uses two moving averages (TMA) to detect R-peaks in electrocardiogram (ECG) signals.R-peaks represent the highest points in the QRS complex, indicating the depolarization of the ventricles.The TMA algorithm leverages the concept of moving averages to identify R-peaks by tracking variations in signal amplitude over time [13].Here are the steps for the TMA algorithm for R-peak detection.

Initialization
Define the window lengths for the fast-moving average (FMA) and the slow-moving average (SMA).The FMA captures short-term changes, while the SMA focuses on longer-term trends in the ECG signal.

Initial averages
Compute the initial FMA and SMA values using the data points within their respective windows.

Iterate through data
Start iterating through the ECG signal data points, moving forward step by step (for each data point).

Concordance Correlation Coefficient (CCC)
Lin's concordance correlation coefficient (CCC) measures how well the observed bivariate is valid against standard measurement methods.CCC was used to evaluate the strength of agreement between the two methods [14].CCC is the product of the Pearson correlation coefficient and the squared difference between measurements.A high coefficient means strong agreement and a linear relationship between methods.The form of the concordance correlation coefficient is defined in Equation 3.
where µ x and µ y are the means for the two variables, σ 2 x and σ 2 y are the corresponding variances, and ρ is the correlation coefficient between the two variables.CCC (ρ c ) measures precision (ρ) and accuracy (Cβ), which has values ranging from 0 to ± 1. Table 2 shows the interpretation of CCC measurement results [15].

Result
This section discusses electrocardiogram resampling and correlation coefficients.As shown in Figure 2 (left), data with 100 Hz as a baseline, when up-sampled into 150 Hz, 200 Hz, and 250 Hz, will produce different numbers of R peaks in the first 1,000 samples.However, the difference in the number of samples after the resampling process did not affect overall number of R peaks detected (Figure 2 right).This can also be seen in the RR-Interval plot results in Figure 3.

Correlation Coefficients
A comparison of the values of HRV features among original HRV (50 Hz) and upsampled HRV up to 100 Hz is shown in Table 3. Measurements were carried out using CCC metric and linear measurements (time and frequency) and non-linear measurements (Poincaré plot and sample entropy).
Table 3 shows the result after the up-sampling process from 50 Hz to 60 Hz.From 17 features, only 3 have CCC values above 0.9, namely NN20, pNN20, and CVI.For the remaining upsampling, only the CVI feature shows moderate correlation up to the 80 Hz limit.Upsampling from 50 Hz to 90 Hz or 100 Hz did not show any correlation in all features.The resampling results for data with a 100 Hz baseline are shown in Table 4 and Table 5.
Table 4 shows that when a 100 Hz signal is down-sampled up to 50 Hz, the CVRR feature correlates with each sampling rate (almost perfect at 90 Hz, 80 Hz, 70 Hz, and substantial at 60 Hz and 50 Hz).The CSI, SD1/SD2 Ratio, and CVSD features only show correlation up to 60 Hz with CCC values above 92 % (> 0.92).The NN20 and pNN20 feature correlate up to 70 Hz (CCC value > 0.92).Downsampling results from 100 Hz to 90 Hz show that many features still correlate with CCC values above 92 %, including SDRR, RMSSD CVRR NN20, pNN20 (time domain), CSI and CVI (frequency domain), SD1, SD2, SD1/SD2 Ratio, CVSD (Poincaré plot).Meanwhile, for the Entropy domain (SampEn feature), CCC still does not show any correlation in any downsampling results.Data with a 100 Hz baseline was also upsampled to 250 Hz with the upsampling results as shown in Table 5.
As shown in Table 5, a comparison of the CCC values from 100 Hz, which upsampled up to 250 Hz, indicates that the CVRR, CVSD, and SampEn features correlate with each sampling rate (except SampEn at 120 Hz).CVRR shows the highest CCC value with a value up to 99.02 % at a 150 Hz sampling rate.The CSI and SD1/SD2 Ratio features correlate at several sampling rates with moderate CCC values (between 90 % and 95 %).Like the results shown in the downsampling process from 100 Hz to 90 Hz, the correlation between 110 Hz and the baseline (100 Hz) is visible in several features; even the SampEn feature also has a moderate correlation (> 0.92).
Scatter plots are used to provide an overview of the distribution of data between the original signal (baseline) and resampled signal.The scatter plot consists of the X-axis, which is the baseline sampling rate, the Y-axis which is the resampling result, the 45-degree line which is the gold standard (faint line), and the deviation line which is the CCC result (clear line).Figure 4 shows a comparison of the data distribution for the CVRR feature from a baseline (50 Hz) when up-sampled to 60 Hz, 80 Hz, and 100 Hz (top image), while the bottom image shows the results of up-sampling from 100 Hz into 110 Hz, 130 Hz, and 150 Hz.The distribution lines between the original 50 Hz signal and the up-sampling results are not in a parallel position.This means that the CCC value from the baseline of 50 Hz has quite a large deviation in the CVRR feature when up-sampled into 60 Hz, 80 Hz, and 100 Hz.Meanwhile, if the original 100 Hz signal is up-sampled into 110 Hz, 130 Hz, and 150 Hz, it shows adjacent/parallel lines.Thus, the up-sampling results shown in Figure 3 have a high level of correlation.
The CCC calculation results show that ECG signal resamples on several HRV features have varying impacts, depending on the measured feature and the level of resampling https://ejournal.ittelkom-pwt.ac.id/index.php/infotelapplied to the original signal.Some features may retain information from the original signal after resampling, while others show significant changes.Therefore, the resampling process should be carefully considered depending on the features to be used in the HRV analysis.

Discussion
This research aims to determine the effect of resampling on HRV features in ECG data.
Upsampling is carried out on ECG data from a low sampling rate to a higher sampling rate, while downsampling is used from a high sampling rate to a lower sampling rate.There are 17 HRV features used in this study, consisting of MeanRR, SDRR, RMSSD, CVRR, NN20, and pNN20 (time domain), VLF, LF, HF, LF/HF Ratio, CSI, and CVI (frequency domain), SD1, SD2, SD1/SD2 ratio, and CVSD (Poincaré plot), and sampEn (entropy).An up-sampling process of ECG data with a 50 Hz baseline was done.Only a few research studies discuss up-sampling techniques for ECG data, especially for HRV analysis.The baseline signal, with a 50 Hz sampling rate up-sampled up to 100 Hz, does not show significant concordance values for most of the HRV features.The results of this research show that of the 17 HRV features used, only three features show the suitability of the upsampling process.These results were only acceptable in up-sampling from 50 Hz to 60 Hz via the NN20, pNN20, and CVI features.NN20 in HRV indicates the number of RR-interval pairs with a difference of more than 20 milliseconds (ms).This feature reflects a faster response to external stimuli or changes in physical activity.Like NN20, the pNN20 feature indicates how significant the heart rate fluctuations are from all observed heart rates in percentage.Elevated NN20 and pNN20 may indicate the more dynamic response of the body to external stimuli or changing conditions.The cardiac vagal index (CVI) reflects the degree to which parasympathetic (vagal) activity contributes to heart rate variability.A higher CVI value indicates domination in parasympathetic activity, which is usually considered an indicator of balance and a better level of relaxation.
HRV features can provide different information about autonomic nervous activity, both in sympathetic and parasympathetic nerve activity [16].Based on the results shown in this study, up-sampling is not recommended for ECG data with a baseline of 50 Hz.A sampling rate of 50 Hz can still be used to measure ECG signals without reducing the accuracy of HRV features in the time domain, but the R-peak waveform experiences slight distortion [9].
Different results were shown in the upsampling process carried out on data with a baseline of 100 Hz.ECG data with a 100 Hz baseline, upsampled up to 250 Hz, shows more features that remain correlated, such as CVRR, CSI, SD1/SD2 Ratio, CVSD, and SampEn.CVRR is used to evaluate parasympathetic nerve function [10].CVRR shows how much variability in the heart rate is about the average heart rate.A decrease in the value of the CVRR feature indicates dysfunction of the parasympathetic nervous system [17].
Several other features, namely CSI and SD1/SD2 Ratio.CSI is a spectral measure that measures how related or aligned the high and low-frequency components are in heart rate variability.A higher CSI value indicates more consistent and balanced nervous activities [18,19].SD1/SD2 ratio in HRV compares SD1 and SD2 from the Poincaré plot.The high SD1/SD2 ratio indicates that parasympathetic activity predominates, whereas the lower ratio indicates the predominance of the sympathetic nervous system.
CVSD reflects variations in high-frequency components of the heart rate estimated from short-term measurements.High CVSD values usually indicate more dynamic and responsive autonomic nervous system activity, while lower values indicate a more regulated balance between the sympathetic and parasympathetic nervous systems [19].Sample Entropy (SampEn) is an analysis method for measuring the complexity and irregularity of HRV data [20].A higher sampEn value indicates a more irregular and complex HRV.In contrast, lower SampEn values indicate a greater degree of regularity and consistency in the RR-Interval.
Upsampling of ECG data with a 100 Hz sampling rate shows better results compared to ECG data, which has a 50 Hz sampling rate.However, there are still many other features that do not show significant CCC values, mainly if up-sampling is carried out at more than 110 Hz.For HRV analysis that focuses on parasympathetic nervous system activity (CVRR, SD1/SD2 Ratio), the up-sampling process on data with a sampling rate of 100 Hz may be carried out down to 250 Hz.Information resulting from the upsampling process on these features can still be maintained.
The down-sampling process is carried out only on data with a sampling rate of 100 Hz.Downsampling to 50 Hz shows similar results with upsampling up to 250 Hz.HRV features such as CVRR, CSI, CVSD, and SD1/SD2 Ratio still show acceptable concordance values (CCC > 0.9).However, it should be noted that downsampling from 100 Hz for these four features is only able to retain information down to 60 Hz.Thus, downsampling to 50 Hz is not recommended because it will eliminate information from the HRV features that have been extracted.R-peak detection on ECG data with a high sampling rate provides acceptable results if the down-sampling process is carried out [21,22].However, this research shows that although R-Peak detection does not have a significant difference, HRV feature extraction on down-sampling data gives different results.Research regarding the effect of downsampling on HRV analysis was also carried out by Kwon [8].Downsampling results from 1,000 Hz to 50 Hz proved unacceptable for HRV analysis in the time domain or the frequency domain.At a sampling rate of 50 Hz, the differences between RMSSD and HF features tend to have high random error values.
The results of this study show concordance values for several HRV parameters.Upsampling was done from 100 Hz to 250 Hz in several domains.However, if up-sampling is carried out from 50 Hz, HRV feature analysis can be carried out on NN20, pNN20, and CVI features only at 60 Hz.However, up-sampling ECG data with a baseline of 50 Hz has not given any contribution to HRV analysis.
Therefore, to analyze HRV features in all domains, a minimum sampling rate of above 100 Hz is recommended.The results of this study also support the latest systematic review regarding the use of HRV in the field of clinical care.Most studies use a sampling rate as low as 250 Hz to enable analysis of HRV in various domains [23].
Further research can be carried out by processing the ECG signal using other resampling techniques.Signal processing using different methods (other than interpolation) is expected to provide better results and has the opportunity so that the ECG data obtained is no longer dependent on the sampling rate and device for data acquisition.

Conclusion
This research evaluates the effect of ECG data resampling on HRV features.Upsampling from 50 Hz to higher levels did not produce significant concordance values, except for the NN20, pNN20, and CVI features (in a 60 Hz sampling rate).Upsampling from 100 Hz to 250 Hz produced better results, with some HRV features still having significant concordance values.Downsampling from 100 Hz to 50 Hz is less satisfactory in HRV feature https://ejournal.ittelkom-pwt.ac.id/index.php/infotelanalysis.Based on the results of this study, it is recommended to use ECG data with a sampling rate above 100 Hz to produce a more comprehensive HRV analysis in all domains.
a. Update FMA: Calculate the FMA value using the current data point and the FMA window.b.Update SMA: Calculate the SMA value using the current data point and the SMA window.c.Compare Averages: Check if the FMA crosses over the SMA.d.If FMA crosses over SMA and the difference exceeds threshold, mark the data point as a potential R-peak.https://ejournal.ittelkom-pwt.ac.id/index.php/infotel

Figure 2 :
Figure 2: ECG signal from 100 Hz baseline resampled up to 250 Hz: Data with initial 1,000 samples (left), adjustment sample size for up sampled data (right).

2.4 Heart Rate Variability Features
Poincaré plot and entropy).Several HRV features provide different insights into heart rate variability.In this study, we used HRV features as shown in Table1.

Table 1 :
Heart rate variability features Power in the very low-frequency range (0.0033 -0.04 Hz) LF Power in the low-frequency range (0.04 -0.15 Hz) HF Power in the high-frequency range (0.15 -0.

Table 3 :
CCC result for HRV features rom 50 Hz baseline upsampled up to 100 Hz

Table 4 :
CCC result for HRV features from 100 Hz baseline downsampled up to 50 Hz

Table 5 :
CCC result for HRV features from 100 Hz baseline upsampled up to 250 Hz