Extended segmented beat modulation method for cardiac beat classification and electrocardiogram denoising