Text this: Wavelet based distortion measurement and enhancement of ECG signal