Cardiac arrhythmias, known as irregular heartbeats, pose a notable health threat that necessitates prompt diagnosis, as untreated arrhythmias can lead to severe heart complications. Among the various methods for arrhythmia detection, electrocardiography is the most prevalent due to its non-invasive monitoring of heart activity. However, manual electrocardiogram (ECG) analysis is inefficient and prone to errors, prompting the exploration of machine learning (ML) models for ECG feature recognition. Integrating ML models with ECG analysis can revolutionize cardiac diagnostics by improving healthcare efficiency and outcomes by enhancing the accuracy and consistency of existing approaches as well as their processing speed for large datasets. Unfortunately, current ML methods encounter two key limitations: prolonged training times and the need for manual feature selection. To address these issues, we propose using ML models enhanced with innovative techniques such as the Fourier transform (FT) and Gaussian noise injection for improved cardiac health assessment. To validate this approach, we utilized statistical tools, including Pearson correlation and p-values, to uncover relationships within the data. In addition, we employed the FT technique to extract and analyze frequency-domain features. Our comparative study of different ML models relied on metrics such as accuracy, precision, recall, F1 score, and receiver operating characteristic area under the receiver operating characteristic curve, demonstrating XGBoost’s impressive average recall of 0.956 with 99.96% overall accuracy. An average precision of 0.956 further underscored the accuracy of XGBoost’s predictions, indicating its high level of reliability in distinguishing various cardiac conditions. These results highlight the considerable potential of ML techniques for precise ECG-based clinical diagnoses, helping healthcare professionals make more accurate and timely decisions in patient care.