Square wave filtering with d-flip flop
user2943160's answer is essentially correct, but not perfect. As he states, there will be a glitch (runt pulse) produced when a pulse which will be swallowed comes along. In this case when the input goes high, the FF output persists high for the propagation delay of the FF, and this will produce a pulse. Likewise, the next pulse which comes along will be shortened by the FF propagation delay.

There are two ways to deal with this. Assuming the FF has a propagation delay of two inverters,







simulate this circuit &ndash; Schematic created using CircuitLab

will work, but it does have the possible drawback that it requires that the FF propagation delay be accurately known. If this is not the case, a more general approach is to operate the FF on the falling edge of the pulse. 







simulate this circuit