1. A positive airway pressure system for treatment of a sleeping disorder in a patient, comprising: a generator supplying airflow and applying a pressure to an airway of a patient; a sensor measuring 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 adjusting the applied pressure as a function of the patient's state.