an implantable heart - monitoring device designed to distinguish two differing heart rhythms . the device comprises electrodes , a template , and first , second and third electronic mechanisms . the first electronic mechanism converts electrical representations of heartbeats from the electrodes into digital data and performs calculations including at least a partial discrete wavelet transform upon the digital data to generate a subset of discrete wavelet transform components including components for distinguishing the two differing heart rhythms and also demonstrated to be relatively low in variability from one patient to another . the template contains a corresponding subset of discrete wavelet transform components captured from at least one individual whose heart was beating in accordance with one of the two differing heart rhythms . the second electronic mechanism correlates the subset of transform components against the template components and provides a correlation value . the third electronic mechanism mathematically examines a time series of the correlation values and gives an indication of whether the first or second of the heart rhythms is present .