High frequency burr in the pulse signal is one of the most important reasons to affect the detection accuracy and reliability of signal. This paper puts forward a real-time filtering method based on State Machine, and gives a speed detection method, which has been successfully applied to military vehicle speed detection. In order to realize filtering, the State Machine, using CPLD as hardware and driven by high frequency clock, detects transient signal, and then filters out the short pulse and outputs the wide pulse. This paper describes in detail the principle of filtering method based on State Machine, and analyses the filtering characteristic as well. By simulating its application on square signal, we discuss its feasibility and the influence of filtering width.