09-01-2010 10:32 AM
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?
09-01-2010 11:03 AM
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
09-01-2010 11:44 AM
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.