Detection of T wave oversensing in an ICD is accomplished in order to prevent improper application of treatment to a patient. The ICD device senses for electrical impulses representing the R waves of a beating heart. In some instances the ICD device will sense T waves that it will assume to be R waves, because the ICD device expects or assumes that such sensed signals are R waves. Time intervals between each detected, assumed R waves are measured and a list of intervals is generated. The list is transformed into its frequency domain equivalent and analyzed for peaks and randomness criteria to determine whether T wave oversensing has occurred.