Pulsestats Functioning inconsistantly

I have implemented pulsestats into a procedure in order to take a long periodic wave, and split it into separate waves, each of one period. The first attached image is an example of a full wave that was correctly split. The second image is zoomed in so you can see the triangular shape of the periodic wave. This has been working fine for disassembling the 200-400 peaks I have to seperate. I have tried again recently to use this procedure, unchanged with just the first fraction of this wave (3rd image), which contains just 7 positive peaks, and the result is that the pulsestats returns NaN for all the stats. I am confused about the implementation of the command.

Variable pulseStop=numpnts(Currentwave)
Variable PulseStart =0
Pulsestats/A=1/B=3/Q/R=[Pulsestart,Pulsestop] Currentwave
Pulsestart= V_pulseloc3

 Above is the relevant code. Reminder that the implementation of this was "flawless" until today, with any number/ amlitude of peaks. The start point is originally from 0, but gets reassigned to the 3rd edge that pulsestats finds, ensuring that there is no double counting. the range ends at the total number of points, so it checks from the end of the previous pulse, to the end of the wave every time.. This is in a do-while loop.

-Thanks

Typical Data that I use pulsestats on zoomed in version of previous image to see the resolution similar data that has worked but far fewer peaks (won't work with pulsestats)

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More