# Online Algorithm for Deriving Heart Rate Variability Components and Their Time-Frequency Analysis
## 4 Discussion  
The aim of this study was to derive and validate an online HRV decomposition method and determine the characteristics of the HF, LF, VLF, and ULF components based on real data. For the latter purpose, it was compared with the modified AVMD and other offline decomposition methods used so far. Moreover, although the preprocessing of ECG signals had to be adapted to their database-dependent form, all algorithms compared in this work operated on the same HRV, so the preprocessing itself had no influence on the obtained results. In the study presented here, only a moderate-level random noise in the synthetic HRV, simulating R peak-positioning errors in ECG, was considered. On the other hand, it would be interesting to comprehensively evaluate the influence of typical ECG disturbances on HRV-decomposing results by the proposed algorithms. In this case, it would be necessary to use a standard pure ECG signal and numerical models simulating individual disturbances, which, however, is beyond the scope and purpose of this work. Therefore, solving this problem requires new research, which the authors plan for the future. It has been previously shown that AVMD is better than the use of STFT and EMD and comparable to MBF (while still being better for extracting HF and LF) [47]. With this in mind, it can be now stated that the evaluated own-elaborated algorithms, VMDon and AVMD, as well as standard CWT, proved to be better than others previously used for HRV decomposition. In addition, the modification of the aforementioned AVMD algorithm used in this work enabled the extraction of ULF from all analyzed HRVs (the original version did not always succeed). The analyzed algorithms require uniform sampling. A resampling to 2 Hz was chosen after testing the impact of lower and higher sampling rates. The lower ones led to low HRV resolution and the need for an upper limit on the HRV spectrum, while higher sampling frequencies did not change the results but required more computing power to, for example, be able to update the data every 0.25 s for 4 Hz. It was also noted that removing the window-averaged residuals after each extracted component does not significantly affect the results. It turns out, however, that the residuals after the VMDon algorithm are an order of magnitude larger than after AVMD. Using the synthetic signal, it is possible to observe a part of the HF component in them, while at the same time, VMDon performs noticeably worse with HF than AVMD (Table 2). This leads to the conclusion that, in the future, one can try to improve the extraction of the HF component by a modified version of VMDon, considering the residuals. Figures 3-5 and more accurately Table 2 show, using synthetic data representing ground truth, that both proposed methods, VMDon and modified AVMD, perform well in decomposing HRV into the four known frequency components. The distortions seen in the extracted components, especially HF and LF (Figure 3), are due to the operation of the VMDon procedure using a sliding window and determining only one component sample for a given window position. Although the averaging of such obtained values for a given moment covered by many consecutive window positions and SGF filtering reduce the level of interference, nevertheless, the essence of the implemented procedure is the discrete nature of the extracted components. The situation is similar when summing the corresponding IMFs forming a given component in the AVMD procedure. This effect is enhanced when the FM of the components is determined (Figure 5), since this procedure requires the numerical calculation of the derivative of the instantaneous phase returned by the Hilbert transform, and the differentiation, having the nature of high-pass filtering, amplifies the energy of high-frequency interference. Nonetheless, using SGF to directly calculate the derivative from the instantaneous phase after HHT gave much better resultscompared to the previously used method based on the discrete first-order derivative and subsequent median filtering [47].