Simple algorith for detecting t-peak