@@ -558,8 +558,8 @@ Input arguments:
558
558
- ``window_size `` (required): The smoothing window width.
559
559
560
560
561
- GQRS detector
562
- ~~~~~~~~~~~~~
561
+ Peak detection
562
+ ~~~~~~~~~~~~~~
563
563
564
564
**gqrs_detect ** - The GQRS detector function
565
565
@@ -576,8 +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
-
580
- peak_indexes = wfdb.processing.gqrs_detect(x=x, freq=fields['fs'], gain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
579
+ peak_indexes = wfdb.processing.gqrs_detect(x=sig[:,0], freq=fields['fs'], gain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
581
580
582
581
Input arguments:
583
582
@@ -598,6 +597,40 @@ Input arguments:
598
597
- ``QRSamin `` (default=130): Minimum QRS peak-to-peak amplitude, in microvolts.
599
598
600
599
600
+ **correct_peaks ** - A post-processing algorithm to correct peaks position.
601
+
602
+ See code comments for details about the algorithm.
603
+
604
+
605
+ ::
606
+
607
+ correct_peaks(x, peaks_indexes, min_gap, max_gap, smooth_window)
608
+
609
+ Example Usage:
610
+
611
+ ::
612
+
613
+ import wfdb
614
+ t0 = 10000
615
+ tf = 20000
616
+ sig, fields = wfdb.srdsamp('sampledata/100', sampfrom=t0, sampto=tf, channels=[0])
617
+ record = wfdb.rdsamp("sampledata/100", sampfrom=t0, sampto=tf, channels=[0], physical=False)
618
+ peak_indexes = wfdb.processing.gqrs_detect(x=sig[:,0], freq=fields['fs'], gain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
619
+ fs = fields['fs']
620
+ min_bpm = 10
621
+ max_bpm = 350
622
+ min_gap = fs*60/min_bpm
623
+ 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)
625
+
626
+ Input arguments:
627
+ peaks_indexes, min_gap, max_gap, smooth_window
628
+ - ``x `` (required): The signal.
629
+ - ``peaks_indexes `` (required): The location of the peaks.
630
+ - ``min_gap `` (required): The minimum gap in samples between two peaks.
631
+ - ``max_gap `` (required): The maximum gap in samples between two peaks.
632
+ - ``smooth_window `` (required): The size of the smoothing window.
633
+
601
634
Based on the original WFDB software package specifications
602
635
----------------------------------------------------------
603
636
0 commit comments