Sleep apnea (SA) is considered one of the most dangerous sleep disorders. That happens when a person is sleeping, his or her breathing repeatedly stops and starts. In order to develop therapies and management strategies that will be effective in treating SA, it is critical to precisely diagnose sleep apnea episodes. In this study, the single-lead electrocardiogram (ECG), one of the most physiologically pertinent markers for SA, is analyzed to identify the SA issue. In this paper, a novel signal processing method is proposed, in which noise filtering is added and the detection of R peaks is utilized. Particularly, the Teager Energy Operator (TEO) algorithm is applied to detect R peaks and then obtain the RR intervals and amplitudes. Afterward, the SE-ResNeXt 50 deep learning model, which has never been used in SA detection before, is used as a classifier to perform the objective. The proposed model, which is a variation of ResNet 50, has the ability to use global information to highlight helpful information while allowing for feature recalibration. In order to confirm the proposed method, the benchmark dataset PhysioNet ECG Sleep Apnea v1.0.0 is used. Results are better than current research, with 89.21% accuracy, 90.29% sensitivity, and 87.36% specificity. This is also clear evidence that the ECG signals can be taken advantage of to efficiently detect SA.