ECG smoothing and denoising by local quadratic variation reduction