HMM-based characterization of channel behavior for networked control systems