Skip to content

Commit

Permalink
Return upper and lower threshold for peak rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
nadine-praxasense committed Jul 8, 2024
1 parent 47f4b9e commit f647a6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions heartpy/peakdetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ def check_peaks(rr_arr, peaklist, ybeat, reject_segmentwise=False, working_data=
upper_threshold = mean_rr + thirty_perc
lower_threshold = mean_rr - thirty_perc

working_data['upper_threshold'] = upper_threshold
working_data['lower_threshold'] = lower_threshold

# identify peaks to exclude based on RR interval
rem_idx = np.where((rr_arr <= lower_threshold) | (rr_arr >= upper_threshold))[0] + 1

Expand Down

0 comments on commit f647a6a

Please sign in to comment.