01-12-2011 02:28 PM
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
01-13-2011 05:02 PM
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
01-14-2011 11:38 AM
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
01-14-2011 02:12 PM
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
01-14-2011 02:14 PM
Oops, sorry!