LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding peaks based on the slope

I am running a gas chromatograph through LabVIEW and wanted to implement an automatic integration.  I was looking at the slope of my peak and had an idea of how to make it work, but I do not know how to implement it.

 

My pseudocode is as follows:

Ai = array of points

pd = positve derivative count = 0 initally

nd = negative derivative count = 0 initally

for i from 0 to n:

   if derivative(Ai)>threshold

      pd = pd +1

  else

      reset pd to 0

  if pd = 10

     store first (x,y) as left point

  if derivative(An-i) < threshold

     nd = nd +1

  else

     reset nd to 0

  if nd = 10

     store (x,y) as right point

split array starting at index for left point and ending at the length (right point - left point)

send new array to integrator

 

So my problem is, I am having troubles with finding the 'picture' for a counter.  I do not know how to make it go back to zero when my condition is false.

 

Thank you for any help you can offer!

0 Kudos
Message 1 of 3
(2,634 Views)

To implement a counter use the +1 (incrementor) and use a shift register to keep the count. 

Have you tried to use the built in peak find algorithms in labview?  These already use 1st and 2nd derivitives for the peakfind as well as a threshold and peak width criteria.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 3
(2,624 Views)

Please do not call LabVIEW VI's and functions "pictures", unless you are going to call functions and statements in a text-based language "hieroglyphics". 

 

To reset to Zero, when the False condition arrives, send -1 to the incrementer, as shown.

 

Maybe try the peak detector in the Point by Point VI's ?

 

 

Message Edited by Broken Arrow on 05-19-2009 12:02 PM
Richard






Message 3 of 3
(2,617 Views)