A method for a device detects periodic breathing in a patient. The method may include receiving a series of event intervals bounded by apnea or hypopnea events detected in respiration of the patient, and processing, upon closure of an event interval, the event interval to determine a character of the event interval, such as any of: probably a periodic breathing cycle; probably not a periodic breathing cycle; and uninformative. The method may further include determining whether to change a current periodic breathing state that indicates whether a periodic breathing episode is in progress, based on a history of event interval characters that is long compared to the typical length of a periodic breathing cycle real-time detection of periodic breathing