Hello,
It is not possible to due filtering in software when using counters. You would need to write an algorithm that would decide whether a pulse was valid. This is simply not possible. What you need is either a low-pass filter circuit to remove any false edges or you need one of our counter/timer boards that have built-in filter clocks that can also reject false pulses. Here is a link to our 6602 board which would work very well for your application:
http://sine.ni.com/apps/we/nioc.vp?cid=1123〈=US
If you choose to implement a simple RC filter, you will simply need to choose R and C combinations that will reject the high frequencies, yet not attenuate your actual signal.
Regards,
Bill B
Applications Engineer
National Instruments