Sleep Apnea and Hypopnea Detection Algorithm