Similar Items: An efficient threshold method for detecting R-peaks in electrocardiogram