The main advantage related to wavelet transforms is that they are localized both in the frequency and time domains. This paper presents an algorithm, based on the wavelet transform, for feature extraction from the electrocardiograph (ECG) signal and recognition of abnormal heartbeats. A method for choosing an optimal mother wavelet from a set of orthogonal and bi-orthogonal wavelet filter bank by means of the best correlation with the ECG signal, was developed. The ECG signal is first denoised by a soft or hard threshold with limitation of 99.99 reconstructs ability and then each PQRST cycle is decomposed into a coefficients vector by the optimal wavelet function. The Coefficients, approximations of the last scale level and the details of the all levels, are used for the ECG analyzed. The coefficients of each cycle are divided into three segments, which are related to the P-wave, QRS complex and T- wave, and summed to obtained a features vector of the signal cycles.