Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecg_process(): Sequence too short to compute heart rate - optimising for short signal #81

Open
dicobrazz opened this issue Oct 7, 2018 · 1 comment

Comments

@dicobrazz
Copy link

Hello,

We are trying to work with some of the researchers from a hospital and there signal samples are at about 2.4 seconds, which is too short. I modified the "interpolate" function and changed k to 2 in signal.py It made the signal run, but still gives ecg_process(): Sequence too short to compute heart rate and therefore, setting heart_rate to np.nan

How could be modified for a short signal? Thank you!

@DominiqueMakowski
Copy link
Member

Hey @dicobrazz.

Short answer is, not really (to my knowledge) ^^. Within such time ranges, I expect you to have around 3 to 4 heart beats per epoch. Let's say 4 for the sake of illustration. Thus, you can only compute 3 different momentary heart rates (b1-b0, b2-b1...). Hence, while you could compute the average (of these several momentary hear rate values) over the whole window, computing the "continuous" heart rate is kind of complicated (and I believed not advised). Indeed, the rationale behind this artificial signal is that the momentary heart rate points (that differs at each new heartbeat) are the reflection of a smooth underlying process.

However, attempting at recovering this underlying process (i.e., the continuous and smooth change of heart rate) heavily rely on interpolation and filtering, which do not work well (and can lead to artefacts) for very short time periods.

Thus, depending on what you need this heart rate for, I would recommend 1) to use the average heart rate, or 2) use the momentary heart rates (made of 2 or 3 points). But again, it depends on what you want to do in the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants