Pan and Tompkins (PAT) algorithm