Early detecetion of ST segment's depression or elevation is very important for prevention of myocardial ischemia and it is very important to prevent a myocardial infarction that may occur in the future. In this study, an algorithm based on Choi-Williams time-frequency distribution was developed in order to early detection of ST segment's depressions or elevations. The performance evaluation of the algorithm was performed on a large database produced from MIT-BIH arrhythmia and European ST-T databases. From the MIT-BIH database, 111688 R-R intervals containing healthy or arrhythmias in V1, V2, V4, V5 leads and R-R intervals with 111688 ST segment's depression or elevation in V1, V2, V3, V4, V5 leads from the European ST-T database were selected. The classification performance results were found as accuracy, sensitivity, specificity and positive predictive value of 99.06%, 99.08%, 99.02% and 99.02%, respectively. These values are above the values belonging to the studies in the literature and the speed of the proposed algorithm is very suitable for telemedicine systems.