A system and method for delivering a flow of gas to an airway of a patient (54). The system includes a gas flow generator (52) and a patient circuit (56) comprising a conduit (100) that communicates the flow of gas to a patient. A sensor (62) is configured to measure a rate of the flow gas and generate flow signals based on the measured rate of flow. A controller (64) is operatively connected with the gas flow generator (52) and the sensor (62) and is configured to control a pressure of the flow of gas provided to the patient. The controller (64) receives the flow signals from the sensor (62), determines a rate of change in the flow of the gas, and modifies or compensates the pressure of the flow of gas provided to the patient if the rate of change in the flow of gas provided to the patient exceeds a threshold amount.