LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

finding peak or shoulder of a curve

I have an array of PMTs.  In order to set the biases individually, I need to identify a particular feature on a spectral curve and measure where it lies for each PMT.  Due to the different physical characteristics of the tubes, and the fact that the source (Na-22) is not the same distance away for each tube, each energy spectrum is different.  I need to pick out the 511 keV peak, and have written a program which does it well; as long as the curve has a well pronounced peak that is.  For curves where the peak is not pronounced (more of a shoulder than a peak), my program is useless.
Does anyone know of a method for picking out these more subtle features of a curve...even a good third party package?
It has been suggested that I do curve fitting first but I don't know of a formula describing the curve and so have not had much luck with the curve fitting VIs built into LabVIEW.
The attached picture shows a curve with a "good" peak and one which is "bad" and has no pronounced peak.
Any guidance is appreciated.
0 Kudos
Message 1 of 13
(5,070 Views)
Take a look at the first, second (maybe even third and fourth) derivatives of the curves to see if your peak or shoulder stands out more.  Maybe even some combination of characteristics from them could be used.

If you like, post the two sets of data you displayed.



Message Edited by rpursley8 on 10-05-2005 09:56 AM

Randall Pursley
0 Kudos
Message 2 of 13
(5,039 Views)
Hey, thanks for the reply.  I will do as you suggest and see what happens.  Attached is a little VI to display the two curves.
0 Kudos
Message 3 of 13
(5,027 Views)
You could also use limit testing under the waveform monitoring section. It is setup to work with waveforms as the input, but I have hacked it to work with arrays as the input.
0 Kudos
Message 4 of 13
(5,023 Views)
Can you save this as a 7.0 format file?? The signal processing toolkit has a denoise and detrend vi that may help also.
0 Kudos
Message 5 of 13
(5,021 Views)
unclebump, I don't have7.0....sorry.  Is there a way to make my 7.1 program backwards compatible before saving it?
0 Kudos
Message 6 of 13
(5,017 Views)
File, Save with options, Save for previous.
0 Kudos
Message 7 of 13
(5,014 Views)
attached is the 7.0 version; thanks for teaching me how to save it with options.
0 Kudos
Message 8 of 13
(5,012 Views)
Briefly looking at your data, if you take the first derivative of your data, a local peak would appear as a positive to negative zero crossing, and if there is not an actual peak, then the point you are looking for is the point that is closest to zero but still negative (since the slope of this line is never positive, but gets close at the saddle point).  Don't know enough to know how noisy your data is though.
Randall Pursley
0 Kudos
Message 9 of 13
(4,997 Views)
Yes, this is the problem I ran into trying to write my own peak finding algorithm.  When there is no positive-to-negative slope crossing, it becomes had to define a peak.  If I just look for "closest to zero but still negative", I will get a point on the plateau, far past the point I want to locate.  Our eyes can do a pretty good job of finding the  feature in the curve, but it's proving difficult to come up with a decent algorithm since I want the computer to make no assumptions or guesses as to where the point may be...just identify a feature.  Maybe that's my problem....

0 Kudos
Message 10 of 13
(4,994 Views)