A positive airway pressure system for treatment of a sleeping disorder in a patient, comprises a generator supplying airflow and applying a pressure to an airway of a patient. A sensor measures data corresponding to patient's breathing patterns, and a processing arrangement analyzing the breathing patterns to determine whether the breathing patterns are indicative of one of the following patient's states: (i) a regular breathing state, (ii) a sleep disorder breathing state, (iii) a REM sleep state and (iv) a troubled wakefulness state. The processing arrangement adjusts the applied pressure as a function of the patient's state; when the breathing patterns indicate state (iv), the processing arrangement sets a target pressure value and controls the generator to adjust the pressure to approach the target pressure value. Also, a system for monitoring breathing of a patient, comprises a sensor measuring data corresponding to the patient's breathing patterns, and a processing arrangement determining whether the breathing patterns are indicative of a troubled wakefulness state.