From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the time between two peaks.

Hello,

 

I am trying to create a VI in which I am supposed to find the time interval between two peaks of waveform.The peak detection I am doing using a case structure using threshold values.

My problem is finding the time interval.Is there any block, which I can directly use, which triggers and resets as I want , and mean time returns the duration between that.

I tried using the elapsed time VI , but it seems it is only for getting th elapsed time if you have the run time known.

 

Any hint will be appreciated.

 

Thank You very much

 

Anupam

 

0 Kudos
Message 1 of 4
(2,692 Views)

No one will be able to give you relevant help, unless you attach your VI.

Message 2 of 4
(2,686 Views)

I just did this in a project, I don't think there is a built in VI or block to use as suggested.  I used threshold VI to find raising edges, then manually data searched for the falling edge across the same threshold.  The points between that represent the 'peak event' and I then found the position and max value of the highest peak in that dataset.  Once you have each peak, you can get differences between them with simple subtraction of the timestamps.  Lots of other things to consider like if you are sampling in blocks, how to handle peaks crossing sample sets, cache that data, and if you have other filters, like discrimination width or other filters to apply.  Hopefully you don't need all those other things, as its gets complicated, but hope that helps you get a solution as well.

Message 3 of 4
(2,679 Views)

Hello people,

Thanks for your answers.

Using threshold is a good idea, rather than using case structures. I was trying to use it, but it was somehow not working.(VI attached).

 

Can you have a look at my VI and comment.

 

Thanks.

0 Kudos
Message 4 of 4
(2,639 Views)