@@ -735,26 +735,6 @@ See code comments for details about the algorithm.
735
735
736
736
correct_peaks(x, peak_indices, min_gap, max_gap, smooth_window)
737
737
738
- Example Usage:
739
-
740
- ::
741
-
742
- import wfdb
743
- t0 = 10000
744
- tf = 20000
745
- sig, fields = wfdb.srdsamp('sampledata/100', sampfrom=t0, sampto=tf, channels=[0])
746
- record = wfdb.rdsamp("sampledata/100", sampfrom=t0, sampto=tf, channels=[0], physical=False)
747
- peak_indices = wfdb.processing.gqrs_detect(x=sig[:,0], frequency=fields['fs'],
748
- adcgain=record.adcgain[0], adczero=record.adczero[0],
749
- threshold=1.0)
750
- fs = fields['fs']
751
- min_bpm = 10
752
- max_bpm = 350
753
- min_gap = fs*60/min_bpm
754
- max_gap = fs*60/max_bpm
755
- new_indices = wfdb.processing.correct_peaks(x=sig[:,0], peak_indices=peak_indices,
756
- min_gap=min_gap, max_gap=max_gap, smooth_window=150)
757
-
758
738
Input arguments:
759
739
760
740
- ``x `` (required): The signal.
@@ -768,6 +748,28 @@ Output Arguments:
768
748
- ``new_indices ``: A python list containing the new peaks indices.
769
749
770
750
751
+ Example Usage:
752
+
753
+ ::
754
+
755
+ import wfdb
756
+ t0 = 10000
757
+ tf = 20000
758
+ record = wfdb.rdsamp('sampledata/100', sampfrom=t0, sampto=tf, channels=[0])
759
+ d_signal = record.adc()[:,0]
760
+ peak_indices = wfdb.processing.gqrs_detect(d_signal, fs=record.fs,
761
+ adcgain=record.adcgain[0],
762
+ adczero=record.adczero[0],
763
+ threshold=1.0)
764
+ min_bpm = 10
765
+ max_bpm = 350
766
+ min_gap = record.fs*60/min_bpm
767
+ max_gap = record.fs*60/max_bpm
768
+ new_indices = wfdb.processing.correct_peaks(d_signal, peak_indices=peak_indices,
769
+ min_gap=min_gap, max_gap=max_gap,
770
+ smooth_window=150)
771
+
772
+
771
773
Heart Rate
772
774
~~~~~~~~~~~~~~
773
775
@@ -777,18 +779,6 @@ Heart Rate
777
779
778
780
compute_hr(siglen, peak_indices, fs)
779
781
780
- Example Usage:
781
-
782
- ::
783
-
784
- import wfdb
785
- t0 = 10000
786
- tf = 20000
787
- sig, fields = wfdb.srdsamp('sampledata/100', sampfrom=t0, sampto=tf, channels=[0])
788
- record = wfdb.rdsamp("sampledata/100", sampfrom=t0, sampto=tf, channels=[0], physical=False)
789
- peak_indices = wfdb.processing.gqrs_detect(x=sig[:,0], frequency=fields['fs'], adcgain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
790
- hr = compute_hr(siglen=tf-t0, peak_indices=peak_indices, fs=fields['fs'])
791
-
792
782
Input arguments:
793
783
794
784
- ``siglen `` (required): The length of the corresponding signal.
@@ -801,6 +791,22 @@ Output Arguments:
801
791
- ``hr ``: A numpy array of the instantaneous heart rate, with the length of the corresponding signal. Contains numpy.nan where heart rate could not be computed.
802
792
803
793
794
+ Example Usage:
795
+
796
+ ::
797
+
798
+ import wfdb
799
+ t0 = 10000
800
+ tf = 20000
801
+ record = wfdb.rdsamp("sampledata/100", sampfrom=t0, sampto=tf, channels=[0])
802
+ peak_indices = wfdb.processing.gqrs_detect(record.adc(), fs=record.fs,
803
+ adcgain=record.adcgain[0],
804
+ adczero=record.adczero[0],
805
+ threshold=1.0)
806
+ hr = wfdb.processing.compute_hr(siglen=tf-t0, peak_indices=peak_indices, fs=record.fs)
807
+
808
+
809
+
804
810
805
811
Based on the original WFDB software package specifications
806
812
----------------------------------------------------------
0 commit comments