def procedure(waves, points, begin_time, end_time, settings):
    wave = waves['Signal']
    R = points['R']
    dzdtmax = points['dzdtmax']
    r_x = []
    r_y = []
    for i in range(0, (len(R) - 1)):
        data = wave.data_slice(R.data_x[i], R.data_x[(i + 1)])
        RZ = ((dzdtmax.data_x[i] - R.data_x[i]) / wave.sample_length)
        RB = (((1.233 * RZ) - (0.0032 * (RZ * RZ))) - 31.59)
        t = int(round(RB))
        if (t < 0):
            t = 0
        r_y.append(data[t])
        r_x.append((R.data_x[i] + (t * wave.sample_length)))
    return (r_x, r_y)
def procedure(waves, points, begin_time, end_time, settings):
    wave = waves['Signal']
    R = points['R']
    dzdtmax = points['dzdtmax']
    r_x = []
    r_y = []
    for i in range(0, (len(R) - 1)):
        data = wave.data_slice(R.data_x[i], R.data_x[(i + 1)])
        RZ = ((dzdtmax.data_x[i] - R.data_x[i]) / wave.sample_length)
        RB = (((1.233 * RZ) - (0.0032 * (RZ * RZ))) - 31.59)
        t = int(round(RB))
        if (t < 0):
            t = 0
        r_y.append(data[t])
        r_x.append((R.data_x[i] + (t * wave.sample_length)))
    return (r_x, r_y)