phuselab / pyVHR

Python framework for Virtual Heart Rate

Home Page:http://phuselab.di.unimi.it/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signal Windowing

B-Acharya opened this issue · comments

Hello,
First, thank you for this amazing pipeline that you have provided. I would have just one doubt regarding the windowing of the signal (splitting them into overlapping windows), as to why this is done. As I understand, it should be possible to generate one single BVP signal and then this can be processed to get the required metrics. Is there a more obvious reason that I am missing that you opt to first segment the signal and then process it.
Hoping to hear from you. :)

Hello @B-Acharya,
Yes, in principle, is possible to generate a single BVP signal from the entire RGB trace. For most methods it makes no difference to work with the entire signal or the windowed one. However, for others, (typically statistical methods, eg, ICA, PCA, ecc) it may be beneficial to perform the computations in different windows, as some statistics may change in time. For the sake of generality pyVHR has been structured in this way.

In any case, the windowing has to be performed on the estimated BVP signal in order to compute BPM values. Indeed, pyVHR performs spectral estimation in order to compute BPMs. Consequently, signal windowing is necessary for at least two reasons:

  1. The spectral estimation using FFT requires stationary signals. The stationarity condition is more likely to be met if working with smaller portions of the original signal.

  2. Employing overlapping windows allows to inspect the evolution of the Heart Rate in time rather than yielding a single BPM estimate for an entire session. This, we believe, is much more informative and useful.

Cheers,
Alessandro