An algorithm to detect P- and T-waves in an electrocardiogram (ECG) signal is presented. The algorithm has physical origins inspired by weak signal detection by leveraging stochastic resonance (SR) in a well potential. Specifically, a particle inside an underdamped monostable well is introduced with the ECG signal. The parameters defining the well and system characteristics are optimized towards enhancing the P-, R-, and T -waves while suppressing the other portions including noise-only sections. The enhanced features are detected by thresholding. Based on the performance obtained from the QT database, the algorithm achieves an average sensitivity of 99.97% for P-waves and an average sensitivity of 99.35% for T-waves, better than most P- and T-wave detection algorithms reported. Clinical Relevance- The proposed SR algorithm achieves high P- and T-wave detection performance and can potentially be integrated with implantable long-term cardiac monitors for patients experiencing rare symptoms without deteriorating the battery life.