A respiratory therapy system comprising: a flow generator adapted to provide pressurized gases to a patient, a sensor adapted to measure at least one characteristic capable of being used to determine one or more traits of a sleep-disordered breathing event (SDBE) of the patient, and a hardware controller configured to: in a first therapy mode, control the flow generator to deliver pressurized gases at a first pressure level for a first time period and to deliver pressurized gases at a second pressure level for a second time period; determine for each of the first time period and the second time period a sleep index based on one or more traits of the SDBE of the patient by analyzing the at least one characteristic; and determine a pressure window of a second therapy mode, the pressure window comprising a minimum pressure limit and a maximum pressure limit, wherein the hardware controller is configured to determine the pressure window by using a continuous function that associates a sleep index with a pressure level; and define the minimum pressure limit and/or the maximum pressure limit of the pressure window based on the determined sleep indices, the minimum pressure limit being less than the maximum pressure limit. a flow generator adapted to provide pressurized gases to a patient, a sensor adapted to measure at least one characteristic capable of being used to determine one or more traits of a sleep-disordered breathing event (SDBE) of the patient, and a hardware controller configured to: in a first therapy mode, control the flow generator to deliver pressurized gases at a first pressure level for a first time period and to deliver pressurized gases at a second pressure level for a second time period; determine for each of the first time period and the second time period a sleep index based on one or more traits of the SDBE of the patient by analyzing the at least one characteristic; and determine a pressure window of a second therapy mode, the pressure window comprising a minimum pressure limit and a maximum pressure limit, wherein the hardware controller is configured to determine the pressure window by using a continuous function that associates a sleep index with a pressure level; and define the minimum pressure limit and/or the maximum pressure limit of the pressure window based on the determined sleep indices, the minimum pressure limit being less than the maximum pressure limit. in a first therapy mode, control the flow generator to deliver pressurized gases at a first pressure level for a first time period and to deliver pressurized gases at a second pressure level for a second time period; determine for each of the first time period and the second time period a sleep index based on one or more traits of the SDBE of the patient by analyzing the at least one characteristic; and determine a pressure window of a second therapy mode, the pressure window comprising a minimum pressure limit and a maximum pressure limit, wherein the hardware controller is configured to determine the pressure window by using a continuous function that associates a sleep index with a pressure level; and define the minimum pressure limit and/or the maximum pressure limit of the pressure window based on the determined sleep indices, the minimum pressure limit being less than the maximum pressure limit. <EOS>