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