Online apnea–bradycardia detection based on hidden semi-Markov models