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