From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

peak to peak time

Solved!
Go to solution

Hello,

I'm using Labview 7.1 and I am having a hard time trying to calculate peak to peak Time value.

 

I am using the DAQ Assistant to aquire a continous analog signal.  I used the example vi "advanced peak detector.vi" to detect the peak values which works great. However, is there a way to find the Time between peaks? I guess what I am trying to do is displaying the difference between the current peak time with previous peak time of a continous signal.

0 Kudos
Message 1 of 18
(5,127 Views)
Solution
Accepted by topic author immortalc

Yes, use a shift register.

 peak dist.PNG

The output of this will be an array of distances between peaks.

Edit: In my image, I have the values subtracting in the wrong order.
Just switch the wires leading to the subtraction function so the bottom wire is on top and visa versa
Message Edited by Cory K on 06-11-2009 01:49 PM
Cory K
0 Kudos
Message 2 of 18
(5,121 Views)

Hi thanks for your help,

 

It seems to be kind of working.  Except I'm inputting a sine wave with a period of 0.5 to 1 seconds and my answers are above 2 seconds.  Another problem I'm experiencing is my answers are disappearing on me.  The peak values counts down to zero and then the number is gone.  I think it has to do with my inputs.  I'm sampling multiple AIs using the DAQ assistant with continuous sampling.

 

Thanks again!

0 Kudos
Message 3 of 18
(5,111 Views)
Can you please post your code?
It will be a little easier for me to see whats going on if I can look at it.
Cory K
0 Kudos
Message 4 of 18
(5,100 Views)

I've attached my VI.

 

So whenever I measure the peak position the numeric values are displayed at the Amplitudes and the peak time in Location.
But with the displays the values count down and then disapear.  Is the Location in units of seconds? because the location time between the peaks are not correct.

 

I created a shift register like you said to do.

 

Also is there a way to record the peaks with my file?  the other signals are waveforms DBL, but detecting the peaks have changed to 1D double array.

 

Thanks for your help!

 

Message Edited by immortalc on 06-17-2009 03:01 PM
0 Kudos
Message 5 of 18
(5,068 Views)

Cory K wrote:

Yes, use a shift register.

 peak dist.PNG

The output of this will be an array of distances between peaks.

Edit: In my image, I have the values subtracting in the wrong order.
Just switch the wires leading to the subtraction function so the bottom wire is on top and visa versa
Message Edited by Cory K on 06-11-2009 01:49 PM

If you have done a peak detection and found n peaks then you will have n-1 intervalsSmiley Tongue

Take a look at the posting I did 06-15-2009 07:11 PM  in this thread

http://forums.ni.com/ni/board/message?board.id=170&message.id=416201#M416201



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 18
(5,058 Views)

I found out if i increase the buffer, the display counts down slower.  So that means the location display is also dependant on the buffer or changing the buffer size changes my time it detects the peaks.

 

 

0 Kudos
Message 7 of 18
(5,052 Views)

Just one quick question.

 

I would like to record the peak values to my file that I'm already measuring with other data.  However, the amplitude data are not compatible with other continuous waveform dbl.

 

dbl.PNG 

 

I understand its because I don't have peak time syncro with the rest of my recordings. Is there a way to fix this?

 

Thanks!

Message Edited by immortalc on 06-18-2009 01:18 PM
0 Kudos
Message 8 of 18
(5,021 Views)
Did you try using Build Waveform VI? 
0 Kudos
Message 9 of 18
(5,001 Views)
I tried using the build waveform vi and I did this: I took the "amplitudes" source and connected that to the Y part of the build waveform VI.

But after that, I have an error with my build array (not shown below).  It seems like its a bad terminal and it's not compatible with the build array even though the wires connect and show no visual errors.

 

I also tried using the t0 and dt from the original waveform. Still the same problem with my build array.  Am I connecting my build waveform to my build array wrong still?

 

build.PNG

Message Edited by immortalc on 06-22-2009 10:02 AM
0 Kudos
Message 10 of 18
(4,968 Views)