A method and medical device for identifying a cardiac waveform that includes sensing cardiac signals, determining a plurality of RR-intervals in response to the sensed cardiac signals, determining R-waves associated with the plurality of RR-intervals, determining P-wave windows in response to the determined R-waves, adjusting P-waves within the P-wave windows, identifying a P-wave parameter in response to the adjusted P-waves, and determining whether a P-wave occurs in response to the identified P-wave parameter.