The application discloses a filtering method for pulse width measurement, which firstly determines whether the pulse
signal frequency in a first specified time period is stable, if stable, corrects the pulse width value according to the real-time cycle width, real-time high level width and real-time low level width obtained by real-time measurement, and determines whether the
signal state of the current measurement pulse is full high, full low or normal according to the corrected pulse width value, then determines the number of the three
signal states in a second specified time period, and determines the real-
time signal state as the state with the largest number; if unstable, determines the real-
time signal state according to the level for capturing the input pin in a third specified time period; finally, determines the output pulse width value according to the real-
time signal state.