While there are plenty of methods to detect R peaks it appears that detecting S peaks is less discussed. Is there a recommended way of detecting S peaks?

Additionally, could you recommend an implementation in python?

  • $\begingroup$ I know extremely little about this to provide any valuable insight, but doesn't the S wave always immediately follow the R wave (in the opposite direction)? Such that if you can detect the R wave you can use that information to more accurately locate the S wave? More of a question since I am not in the biomedical field. $\endgroup$ Commented Mar 18, 2020 at 2:28
  • $\begingroup$ It does and I also think that detecting the R wave gives much information towards detecting the S wave. My concern is that this is more complex than it seems. $\endgroup$ Commented Mar 23, 2020 at 21:19

1 Answer 1


If you are using Python you could try this:

def S_point(signal, R_peaks):

    for index in range(num_peak):
        if cnt+1>=signal.shape[0]:
        while signal[cnt]>signal[cnt+1]:
            if cnt>=signal.shape[0]:
    return np.asarray(S_point_list)

If you allready have the R-peaks then you can use the signal and the R-peaks to get the S_points with this function


And finaly plot it like this

plt.plot(R_peak,signal[R_peak], 'yo')
plt.plot(S_points,signal[S_points], 'ro')

S-point and R-peak

  • $\begingroup$ Thank you for the detailed answer. So you're essentially looking for the nearest point to the right of the R-peak where the downward trend stops. What if this single switch point is a bug somehow and the actual trend continues downward? Is there a common practice for smoothing / checking a window instead of single values? $\endgroup$ Commented Apr 21, 2020 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.