neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.53k stars 410 forks source link

ECG Quality Evaluate by using "ecg_quality" Function #1023

Open ShawnWang126 opened 1 month ago

ShawnWang126 commented 1 month ago

Hi, here are some questions when I use the "ecg_quality"

First, I got a 30 seconds length ECG waveform and analyzed the quality, and then I got the answer "Excellent". But these results let me get some confuse (ECG waveform please refer to the attached image)

Based on this ECG data, the SQI results are as follows: pSQI = 0.8456271730524108 kSQI = -0.018646675312427696 basSQI = 905.027971257324

I use this function and choose method "zhao2018" and mode "fuzzy". Because the results are not what I expected, so I refer to the original literature and check the source code. I found some questions in "ecg_quality.py".

  1. In baseSQI calculation, parameter "UbI" show "UbI = 1.0 / (1 + np.power((basSQI - 95) / 2.5, 2))", but the literature is "basSQI - 92" not "basSQI - 95". Here is a little difference.
  2. In pSQI and basSQI, "R2 = np.array([UpH, UpI, UpJ])" and "R4 = np.array([UbH, UbI, UbJ])", the matrix needs the same as the literature "UxH, UxJ, UxI"? I can't sure if it's will affect the results or not.
  3. In the function "_ecg_quality_basSQI", the basSQI value is larger than 100, it seems don't in the range of the literature definition, I think that may need to adjust the formula for meet in the range 0~100.

Thanks.

Figure_1

welcome[bot] commented 1 month ago

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