This paper introduced an efficient compression technique that uses the compressive sensing (CS) method to obtain and recover sparse electrocardiography (ECG) signals. The recovery of the signal can be achieved by using sampling rates lower than the Nyquist frequency. A novel analysis was proposed in this paper. To apply CS on ECG signal, the first step is to generate a sparse signal, which can be obtained using Modified Discrete Cosine Transform (MDCT) on the given ECG signal. This transformation is a promising key for other transformations used in this search domain and can be considered as the main contribution of this paper. A small number of wavelet components can describe the ECG signal as related work to obtain a sparse ECG signal. A sensing technique for ECG signal compression, which is a novel area of research, is proposed. ECG signals are introduced randomly between any successive beats of the heart. MIT-BIH database can be represented as the experimental database in this domain of research. The MIT-BIH database consists of various ECG signals involving a patient and standard ECG signals. MATLAB can be considered as the simulation tool used in this work. The proposed method's uniqueness was inspired by the compression ratio (CR) and achieved by MDCT. The performance measurement of the recovered signal was done by calculating the percentage root mean difference (PRD), mean square error (MSE), and peak signal to noise ratio (PSNR) besides the calculation of CR. Finally, the simulation results indicated that this work is one of the most important works in ECG signal compression.