Online EM algorithm for HMM and Gaussian mixture