@@ -579,7 +579,7 @@ Example Usage:
579
579
tf = 20000
580
580
sig, fields = wfdb.srdsamp('sampledata/100', sampfrom=t0, sampto=tf, channels=[0])
581
581
record = wfdb.rdsamp("sampledata/100", sampfrom=t0, sampto=tf, channels=[0], physical=False)
582
- peak_indexes = wfdb.processing.gqrs_detect(x=sig[:,0], freq =fields['fs'], gain =record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
582
+ peaks_indexes = wfdb.processing.gqrs_detect(x=sig[:,0], frequency =fields['fs'], adcgain =record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
583
583
584
584
Input arguments:
585
585
@@ -599,6 +599,10 @@ Input arguments:
599
599
- ``QRSa `` (default=750): Typical QRS peak-to-peak amplitude, in microvolts.
600
600
- ``QRSamin `` (default=130): Minimum QRS peak-to-peak amplitude, in microvolts.
601
601
602
+ Output Arguments:
603
+
604
+ - ``peaks_indexes ``: A python list containing the peaks indexes.
605
+
602
606
603
607
**correct_peaks ** - A post-processing algorithm to correct peaks position.
604
608
@@ -624,7 +628,7 @@ Example Usage:
624
628
max_bpm = 350
625
629
min_gap = fs*60/min_bpm
626
630
max_gap = fs*60/max_bpm
627
- y_idxs = wfdb.processing.correct_peaks(x=sig[:,0], peak_indexes=peak_indexes, min_gap=min_gap, max_gap=max_gap, smooth_window=150)
631
+ new_indexes = wfdb.processing.correct_peaks(x=sig[:,0], peak_indexes=peak_indexes, min_gap=min_gap, max_gap=max_gap, smooth_window=150)
628
632
629
633
Input arguments:
630
634
peaks_indexes, min_gap, max_gap, smooth_window
@@ -634,6 +638,45 @@ peaks_indexes, min_gap, max_gap, smooth_window
634
638
- ``max_gap `` (required): The maximum gap in samples between two peaks.
635
639
- ``smooth_window `` (required): The size of the smoothing window.
636
640
641
+ Output Arguments:
642
+
643
+ - ``new_indexes ``: A python list containing the new peaks indexes.
644
+
645
+
646
+ Heart rate
647
+ ~~~~~~~~~~~~~~
648
+
649
+ **compute_hr ** - Compute heart rate from peak indexes and signal frequency.
650
+
651
+ ::
652
+
653
+ compute_hr(length, peaks_indexes, fs)
654
+
655
+ Example Usage:
656
+
657
+ ::
658
+
659
+ import wfdb
660
+ t0 = 10000
661
+ tf = 20000
662
+ sig, fields = wfdb.srdsamp('sampledata/100', sampfrom=t0, sampto=tf, channels=[0])
663
+ record = wfdb.rdsamp("sampledata/100", sampfrom=t0, sampto=tf, channels=[0], physical=False)
664
+ peaks_indexes = wfdb.processing.gqrs_detect(x=sig[:,0], frequency=fields['fs'], adcgain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
665
+ hr = compute_hr(length=tf-t0, peaks_indexes=peaks_indexes, fs=fields['fs'])
666
+
667
+ Input arguments:
668
+
669
+ - ``length `` (required): The length of the corresponding signal.
670
+ - ``peaks_indexes `` (required): The peak indexes.
671
+ - ``fs `` (required): The signal frequency.
672
+
673
+
674
+ Output Arguments:
675
+
676
+ - ``hr ``: A numpy.array containing heart rate for each sample. Contains numpy.nan where heart rate could not be computed.
677
+
678
+
679
+
637
680
Based on the original WFDB software package specifications
638
681
----------------------------------------------------------
639
682
0 commit comments