LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PeakDetector Malfunction?

Hi, I'm working on some data analysis code that needs a peak detector.  Right now I'm using then PeakDetector function from the advanced analysis library, but I'm getting some odd results.  The amplitudes it is returning do not always match my experimental values, sometimes by as much as 1-2%(this is too far off for my needs), though sometimes it returns better values. The actual call I'm using is:

 

Error = PeakDetector (MainData.YGraph, MainData.DataPoints, Threshold, 3, DETECT_PEAKS, ANALYSIS_TRUE, ANALYSIS_TRUE, &Count, &Locations, &Amplitudes, &Derivatives);

 

The error consistently returns 0.  My peaks are usually ~20 data points wide, and I see the issue whether its peaks just above my noise baseline or x1000 my baseline.  The issue is also also independent, or sometimes worsend by increasing the width.  Also if it helps this is all in LabWindows CVI 2009.  So what I'm wondering is, is this an issue with my data/code or is this something to do with the PeakDetect?

 

0 Kudos
Message 1 of 3
(3,166 Views)

Hi,

 

the reason is that PeakDetector is based on an algorithm that fits a quadratic polynomial to sequential groups of data points - and a fit is close to but different from the original data. Depending on your peak shape a quadratic polynomial may not be the best choice. My suggested solution is to perform this analysis yourself using a simple loop: It will be slower but reliable Smiley Happy

0 Kudos
Message 2 of 3
(3,162 Views)

My peaks should be more or less gaussian, but I was afraid this was the issue, and was really hoping to avoid coding this myself. Oh well thanks for the help.

0 Kudos
Message 3 of 3
(3,156 Views)