1. A breath monitoring and treating method comprising: collecting flow rate data of air applied to a patient, compiling the flow rate data into inspiration arrays and expirations arrays by approximating the start and end times of the inspirations and expirations, and determining the maximum peak flow rates during inspiration and minimum peak flow rates during expiration from the flow rate data, adjusting the start and end times of the inspirations and expirations in the arrays of flow rate data to best fit the flow rate data collected.