In this paper, we present a novel algorithm to evaluate the quality of ECG recordings. Our algorithm is designed to help clinicians in rapid selection of good quality ECG segments from long recordings collected by an ECG monitoring device such as a 12-lead bedside monitor. With some adjustments, we used the Computing in Cardiology Challenge 2011 database in order to compare the performance of our algorithm to the published results. The challenge was aimed to develop near real-time algorithms in mobile phones and provide feedback on quality of the ECGs for interpretation to the users who are mostly laypersons with little knowledge of ECG interpretation. Our algorithm generates a noise score which is a combination of two parameters: a high-frequency noise measure which accounts for the muscle noise and other fast changing artifacts, and a baseline wander noise measure quantifying the low-frequency noise. The training dataset (set A) with reference quality assessments was used to determine an optimum threshold on the ROC curve for classification of acceptable and unacceptable segments. The algorithm was then evaluated on the test dataset (set B) with undisclosed annotations. Our method achieved maximum accuracy of 93.9% on the training dataset and an accuracy of 90.2% on the test dataset, placing itself among the top 10 performers who participated in the challenge.