Purpose Electrocardiogram (ECG) signals aid in the clinical assessment of essential body functions by measuring pulse rate, intracranial pressure, respiration rate, and blood pressure. Additionally, ECG signals are employed to identify various heart diseases, such as arrhythmias and myocardial damage. This study aims to reduce the data size of ECG signals while preserving their original ECG characteristics and protecting personal privacy during network transmission. Methods First, we performed amplitude-quantization steganography on ECG signals to hide confidential patient data. We adopted a threshold-based compression technique to reduce the data size of ECG signals while preserving their characteristics as much as possible. We utilized a cubic spline in the recovery of the compressed ECG signal. In addition, the performance of the proposed amplitude-quantization steganography was enhanced by the particle swarm optimization algorithm. Results Experimental results verified the efficiency of the proposed method. Conclusion The proposed method not only protect the security of the ECG transmission but also reduce the amount of ECG transmission. Moreover, the proposed method improves the drawback that the quality of each hidden ECG signal is greatly reduced as the quantization size Q is increased.