Abstract: An algorithm for measuring the breathing of a patient for diagnosing breathing disorders and for controlling a breathing aid device for treating a patient. Sensors record pressure and flow rates of air delivered to a patient. The data is statistically manipulated to find the start of a breath, the end of a breath, the duration of a breath, the shape of a breath, the volume of a breath, the breathing rates, flow rates, snoring index, flattening index, and other useful data to diagnose and treat a patient. The data is used to diagnose the condition of a patient and to control a breathing aide device for treating a patient at the most optimal pressures and flow rates for the patient's condition. Inspiration and expiration data are tracked separately and compared throughout the algorithm as a check the accuracy of the data manipulation by the algorithm.
Abstract: An apparatus for controlling gas delivery to a patient is disclosed, wherein delivery is adapted to maintain a physiological sleep state. The apparatus includes a monitoring device that monitors EEG, EOG, EMG, patient position and patient breathing. The apparatus also contains a microprocessor, which is programmed to derive sleep state specific indicators from the data received by the monitoring device and to determine if the sleep state is in a stable or deteriorating phase, where upon gas pressure will be automatically adjusted to maintain the sleep state if desired. The microprocessor is programmed with a unique automatic sleep staging algorithm and a gas pressure seek algorithm which work together to automatically adjust delivered respiratory gas pressure to a user based upon the determined sleep state and the sleep states condition.