06-06-2007 11:18 AM
06-06-2007 12:10 PM
There are some options available for performing digital filtering on specific PFI pins of the 6602. It's been many years since I fiddled with that filtering feature under traditional NI-DAQ, but there seemed to be some quirks or side effects I wasn't willing to live with. These may or may not apply nowadays under DAQmx (or maybe they never did and I just didn't pursue it hard enough...).
I chose to deal with spurious noise spikes with a crude software filtering technique that worked for my particular situation. It largely depends on expecting a pretty stable & constant value for the intervals being measured. The basic idea behind it goes like this:
1. Find the median value of the measured intervals. The median isn't much influenced by these noise glitches or outliers the way a mean might be.
2. Look for candidate noise glitches. If your nominal interval times are pretty steady, these aren't hard to find. For example, if you're expecting a high time of about 320 usec and there's a glitch somewhere in there, then one of the two measured high times must be less than 1/2 of the true high time.
3. Once you find this way-too-short interval, look at its neighbors. In most cases, it'll be fairly clear which neighbor is a full interval and which is the other "half."
4. If you're measuring semi-periods, there'll also be a very short low time measurement in between those two "halves." Add this time to the two "halves" to reconstruct your true high time.
5. Problems: algorithm needs to get significantly more sophisiticated if there are 2+ noise glitches within one true interval. Also, if actual signal has a highly variable duty cycle, especially one that changes very suddenly, this kind of algorithm may not stand much chance of helping.
-Kevin P.
06-06-2007 01:30 PM
06-09-2007 02:31 AM