An Effective System and Algorithms for Detecting Mine Gases CH4 and CO