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_quality(method='averageQRS') is not bounded #1052

Open
cgastaud opened this issue Nov 24, 2024 · 2 comments
Open

ecg_quality(method='averageQRS') is not bounded #1052

cgastaud opened this issue Nov 24, 2024 · 2 comments

Comments

@cgastaud
Copy link

Describe the bug
In ecg_quality() with method averageQRS, the result is expected to be an array between 0 and 1. However, since after rescaling the signal is interpolated with a quadratic method, this property no longer holds.
This can be easily solved by either choosing a linear interpolation method or clipping the result afterwards.

To Reproduce
ecg = nk.ecg_simulate(duration=10, heart_rate=70, random_state=0)
print(nk.ecg_quality(ecg).min(), nk.ecg_quality(ecg).max())

Expected behaviour
an array between 0 and 1

Copy link

welcome bot commented Nov 24, 2024

Hi 👋 Thanks for reaching out and opening your first issue here! We'll try to come back to you as soon as possible. ❤️ kenobi

@DominiqueMakowski
Copy link
Member

That's a good point. I think we could use the same monotonic interpolation that we use for heart rate; or indeed, linear, which probably makes even more sense. Could you consider making a PR to implement the change?

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