Described is a system including a sensor and a processing arrangement. The sensor measures data corresponding to a patients breathing patterns. The processing arrangement analyzes the breathing patterns to determine whether the breathing patterns are indicative of a REM sleep state. In another embodiment, the processing arrangement analyzes the breathing patterns to determine whether the breathing patterns are indicative of one of the following states: (i) a wake state and (ii) a sleep state. In another embodiment, a neural network analyzes the data to determine whether the breathing patterns are indicative of one of the following states: (i) a REM sleep state, (ii) a wake state and (iii) a sleep state. In another embodiment, the processing arrangement analyzes the data to determine whether the breathing pattern is indicative of an arousal.