PIA-Group / BioSPPy

Biosignal Processing in Python
Other
569 stars 273 forks source link

Online ecg processing from wearable HR monitor #80

Closed sunshineinsandiego closed 3 years ago

sunshineinsandiego commented 3 years ago

Hello - I am wondering if there is a way to use the BioSPPY ecg module without an OpenSignals ECG text file as input? I am streaming ECG data (microvolt readings) at 130hz from a Polar heart rate band, and in order to process it in real-time it seems sub-optimal to try to convert each chunk of data (30x microvolt readings every ~0.2s) into an OpenSignals txt file and then port it back into BioSPPy. Is it possible to feed a simple 2d numpy array (timestamp x microvolt reading) or even a list of microvolt readings coupled with the sampling frequency into the ecg module? Any advice would be welcome! Thanks

hugoslv commented 3 years ago

Hi there,

Many thanks for your interest in BioSPPy. In principle you should be able to use the functions on the ECG module directly, without needing to convert the files to the OpenSignals format.

The top-level ecg function, as well as the segmenters have one input parameter called signal (a 1D array of ECG amplitudes), and a second parameter which is the sampling rate: https://github.com/PIA-Group/BioSPPy/blob/master/biosppy/signals/ecg.py#L32

For example, ecg.ecg(signal=CHUNK, sampling_rate=130.) should return the heart rate, segmented ECG waveforms, and remaining features derived from the default segment.

Do let us know if this works out for you, or if you need any further support from our part.

Cheers, Hugo Silva

On 04 Jun 2021, at 19:36, sunshineinsandiego @.***> wrote:

Hello - I am wondering if there is a way to use the BioSPPY ecg module without an OpenSignals ECG text file as input? I am streaming ECG data (microvolt readings) at 130hz from a Polar heart rate band, and in order to process it in real-time it seems sub-optimal to try to convert each chunk of data (30x microvolt readings every ~0.2s) into an OpenSignals txt file and then port it back into BioSPPy. Is it possible to feed a simple 2d numpy array (timestamp x microvolt reading) or even a list of microvolt readings coupled with the sampling frequency into the ecg module? Any advice would be welcome! Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

sunshineinsandiego commented 3 years ago

Thanks Hugo, super helpful. Will try it out! Closing this question until/if I run into additional issues. Again, thanks!