A gas delivery system including a pressure generator, a pressure sensor, a control valve, and a processor. The pressure generator pressurizes breathable gas for delivery to a patient. The pressure sensor measures a pressure difference between the pressurized breathable gas and atmospheric pressure. The control valve is disposed downstream from the pressure generator and is constructed and arranged to control a flow rate of the pressurized breathable gas. The processor controls the control valve to bring the flow rate of the pressurized breathable gas to substantially zero while the pressure generator is operating and, when the flow rate is substantially zero, determines at least one of atmospheric pressure, an atmospheric air density, or a density correction factor based at least in part on the pressure difference between the pressurized breathable gas and the atmospheric pressure.