Maximum likelihood estimation in hidden Markov models with inhomogeneous noise