LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

express curve fitting multiple peaks

I am trying to use the express gaussian curve fit.vi to fit a waveform of data containing a variable number of peaks. I have input the function as a series of gaussian peaks (a*exp(-((x-b)^2)/(2c^2))+...). My question is how to modify this vi to automatically adapt to a different number of peaks. Right now, I have set it up to handle 4 peaks by summing four of the above equations, but my data may contain anywhere between 1 and 10 peaks, and I don't know how to tell the vi to switch to a different equation model. I am using the peak detector.vi to find locations of the peaks, as well as amplitudes to supply for initial guesses for the a, b, and c terms for each peak (I created a static VI from the express VI and modified it to handle different initial guesses). Is this possible? Thank you in advance,

<>< Eric

0 Kudos
Message 1 of 5
(3,531 Views)

Hi Eric,

 

If you don't mind, could you attach your code so that I could take a look at it on my end to understand your issue a bit further?

 

Thanks,

 

Paul M

National Instruments | Applications Engineer | www.ni.com/support
0 Kudos
Message 2 of 5
(3,505 Views)

Hi Paul,

   Sorry about that, I hadn't posted the code because it was a part of a rather large, complicated program. I have since pared it down, so attached is the code that I am working with. Not the cleanest, it is just for a temporary solution. The peak fitting routine is simply the express fit vi that has been turned into a standalone vi. I have also attached a data file of the type that I am using with this software; the forum will not allow attaching a .tdms file, so I have added .txt to the end of the filename, just remove this to use the file as intended. Thank you for your help,

<>< Eric

0 Kudos
Message 3 of 5
(3,484 Views)

Hi Eric,

 

Could you also send over the Gaussian Curve Fit.Vi that you made, that way I can run your program.

 

Thanks,

 

Paul M

National Instruments | Applications Engineer | www.ni.com/support
0 Kudos
Message 4 of 5
(3,474 Views)
0 Kudos
Message 5 of 5
(3,472 Views)