Compute_Hr function miscalculates.
Personne n'a encore pris cette issue.
- Langage dominant
- Jupyter Notebook
- Étoiles
- 853
- Forks
- 322
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I am working on the MIT-BIH records. The aim is to calculate the Heart Rate and find the maximum, minimum and the mean of the Heart rates. I extracted the ECG signal from the record, calculated the QRS peaks and calculated the Heart Rates using the compute_hr function from the wfdb package. Similarly extracted the QRS peaks from the annotation file and calculated the Heart Rates using the compute_hr function from the wfdb package. For the 101 record, the maximum Heart Rate from the annotations is 900.00bpm while the calculated qrs indices gave a maximum Heart rate of 111.3402bpm. I have this issue with many other records.
Python code:
record = wfdb.rdrecord(record_path, channels=[0])
ann_ref = wfdb.rdann(record_path,'atr')
qrs_inds = processing.gqrs_detect(sig=record.p_signal[:,0], fs=record.fs)
heart_rate_wfdb = processing.compute_hr(sig_len=record.p_signal.shape[0], qrs_inds=qrs_inds, fs=record.fs)
heart_rate_wfdb = heart_rate_wfdb[np.logical_not(np.isnan(heart_rate_wfdb))]
heart_rate_min = "{0:.4f}".format(np.amin(heart_rate_wfdb))
heart_rate_max = "{0:.4f}".format(np.amax(heart_rate_wfdb))
heart_rate_mean = "{0:.4f}".format(np.mean(heart_rate_wfdb))
ref_heart_rate_wfdb = processing.compute_hr(sig_len=record.p_signal.shape[0], qrs_inds=ann_ref.sample[1:], fs=record.fs)
ref_heart_rate_wfdb = ref_heart_rate_wfdb[np.logical_not(np.isnan(ref_heart_rate_wfdb))]
ref_heart_rate_min = "{0:.4f}".format(np.amin(ref_heart_rate_wfdb))
ref_heart_rate_max = "{0:.4f}".format(np.amax(ref_heart_rate_wfdb))
ref_heart_rate_mean = "{0:.4f}".format(np.mean(ref_heart_rate_wfdb))`
Can someone tell me what is that I am doing wrong?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez au point d’entrée processing.compute_hr et reproduisez la comparaison en utilisant record 101, qrs_inds et ann_ref.sample[1:] de l’issue. Vérifiez comment les deux entrées d’indices QRS produisent des extrema de fréquence cardiaque différents ; le travail est terminé lorsque l’écart est expliqué et que tout défaut confirmé est couvert par un test de régression.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- data
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100