Wireless electrocardiography (ECG) systems are crucial in detecting and diagnosing heart disorders. Minimizing power consumption and sampling-rate should be the key aspects when designing wireless ECG systems. In order to achieve portability coupled with ultra-low power consumption and sampling-rate, clustering and classification algorithms play an important role in developing wireless ECG systems. Currently used algorithms do have their share of drawbacks: 1) clustering and classification cannot be done in real time; 2) implementing existing algorithms would lead to higher computational costs. These drawbacks motivated us in developing novel optimized clustering algorithm which could easily scan large ECG datasets for characteristic bio-markers. In this paper, we present an advanced K-means clustering algorithm based on K-Singular Value Decomposition (K-SVD) approach with a connection to Compressed Sensing (CS) theory, followed by sorting the data using a K-Nearest Neighbours (K-NN) classifier. The proposed algorithm outperforms existing algorithms by achieving a classification accuracy of 99.3%. This ability allows reducing 15% of Average Classification Error (ACE). The proposed algorithm also reduces the clustering energy consumption by increasing the classification performance.