LabVIEW Peak Detect VI Is Counting Double the Number of Peaks Then Actual Peaks

Updated Nov 7, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am using the peak detect to count the number of pulses in my digital signal. I cannot use a counter because I am using an HSDIO card. Why is the peak detect VI counting double the peaks then there are?

Solution

Rather than using the peak detect VI, you should use the threshold peak detector VI. Not only will this get your number of peaks, but it runs faster.

Additional Information

The peak detect VI is meant for detecting peaks in an analog signal, not so much digital signals. The VI finds the peak locations in each block, relative to the previously analyzed blocks. This can cause the VI to detect peaks at the rising and falling edge if the signal is flat for too long, rather than the center of the actual peak. To understand more about it read this article on peak detection. Attached is a VI to help explain some of the behavior.