This paper tried to address several topics concerning the analysis, synthesis and compression of the electrocardiogram signal (ECG) using the MIT database. We detect the R-wave by identifying the location of each interval delineating a QRS complex using unbiased and biased estimators. In the second part of the work, we segmented the signal into RR periods constituting the vectors of a data matrix, where we extracted its main components in order to reduce the size of the cardiac information, and then further reduced in addition the size by the use of a threshold on the signal. Then the classification is done for automatic detection of heart disease using Support Vector Machine (SVM) and Cuckoo Search Optimized Neural Network. ECG beats with 4 types of abnormalities (RBBB, APC, PVC and LBBB) from ECG records is retrieved from the MIT-BIH arrhythmia database. Analysis of the different groups shows the overall recognition performance was 99.50%. The worst is 99.63% for the RBBB class.