- A new distortion measure for ECG signal compression is introduced. This diagnostic distortion measure, called the Weighted Diagnostic Distortion (WDD), is based on comparing the PQRST complex features (such as: P wave duration, P wave amplitude, P wave shape, QT duration, ST elevation, etc.) between two signals (original ECG signal and reconstructed ECG signal). Also in this article, a new compression algorithm is introduced, based on analysis by synthesis coding. In our compression system the encoder consists of a long term and a short term predictors and a quantizer with an adaptive number and values of levels, which are depended on the definition of maximum permitted distortion for each segment in the signal. The algorithm exhibits better results than other known compression algorithms.