A Framework for ECG Signal Preprocessing based on Quadratic Variation Reduction