How to detect S wave peaks in ecg
If you are using Python you could try this:



def S_point(signal, R_peaks):

    num_peak=R_peaks.shape[0]
    S_point_list=list()
    for index in range(num_peak):
        i=R_peaks[index]
        cnt=i
        if cnt+1&gt;=signal.shape[0]:
            break
        while signal[cnt]&gt;signal[cnt+1]:
            cnt+=1
            if cnt&gt;=signal.shape[0]:
                break
        S_point_list.append(cnt)
    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

S_points=S_point(signal,R_peaks)


And finaly plot it like this

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