An implantable device includes one or more electrodes to sense an electrical signal from a brain and a waveform analyzer to identify a half wave in the electrical signal; determine an amplitude and a duration of the half wave; determine if the amplitude satisfies a half wave amplitude criterion defined by a set of amplitude parameters comprising a minimum half wave amplitude and a maximum half wave amplitude; determine if the duration satisfies a half wave duration criterion defined by a set of duration parameters comprising a minimum half wave duration and a maximum half wave duration; and identify the half wave as a qualified half wave when the half wave amplitude criterion and the half wave duration criterion is satisfied. A neurological event may be detected based on one or more qualified half waves and electrical stimulation therapy may be delivered to the brain in response to the detection.