LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Time at Peaks

Hello

I have set up a peak detector that uses a for loop to filter out peaks below a certain threshold. I am trying to build a time array of the time that each peak above the threshold is detected. Time is being appended to the array each time a peak above the threshold is detected, but the times all match and continually increase. Any ideas on how to get the time at peaks?

Thanks!

Download All
0 Kudos
Message 1 of 3
(147 Views)

You are only getting the time (mS) it takes the loop to iterate and find a value over the threshold;

 

TBH: If the time peaks occurred is something you are interested in, you should have time stamped your data as you took it.

 

But if your data was taken at regular intervals you can probably use the value of iteration counter in the For-Loop each time the threshold is reached.

Then multiply the count value by the time interval between data points.

 

Also next time post your code, the actual VI not a picture.

========================
=== Engineer Ambiguously ===
========================
Message 2 of 3
(132 Views)

The output if your "time" is a ms counter where only relative values (i.e. difference between two reading) are useful.

Your loop takes much less than a millisecond, thus all outputs will typically be the same.

 

Assuming the dt for the array values, you can calculate the relative times based on the iteration terminal.

 

Of course your code is flawed and assumes that you have spikes. A typical peak will have successive elements above the threshold.

0 Kudos
Message 3 of 3
(105 Views)