03-21-2014 12:11 PM
Hi,
I have a two column data set (x,y) that contain large number of Gaussian peaks ( several hundredes infact). You can think of it more like a wavelength spectrum. The number of spectral peaks is not known exactly. There is no problem in detecting the peaks as they are of same amplitude. Eventually I want to fit a Gaussian funtion to each of these spectral peak and obtain the the parameters such as amplitude, line-center and sigma. This seems a somewhat tricky in LabVIEW. There is an example ( Sum of 3 Gaussian with offset) that comes bundled with LabVIEW. This example VI however uses a static refrence to a model function which is sum of three gaussian curves. This works well for few number of peaks in the data. If we have large number of peaks ( e.g spectroscopy data) then creating such a model function for a large number of peaks is nealy impractical. Is there a better way to handle such peak-fitting problems in LabVIEW? Would greatly appreciate if someone could point out any existing LV code/library function.
Regards,
RK
Solved! Go to Solution.
03-21-2014 01:01 PM - edited 03-22-2014 11:19 PM
Well, all you need to do is make the model function scaleable so it generates an arbitrary number of peaks, based on the number of fitting paramters given. (See e.g. example #2 here)
You could get initial estimated from the Peak detector.
Can you show us a typical spectrum?
Are all widths similar?
03-21-2014 01:50 PM
I looked in to this problem a few years ago. The problem I encountered was that for each peak in my signal, I was basically trying to fit 4 parameters... so 10 peaks = 40 individual parameters that had to be approximated for the fitting function to even be close.
I ended up doing exactly what altenback said: I used the built in peak detect, "guessed" the edges of the peak, split the array, and then did a sum of 2 gaussian + background fit for that split array.
03-23-2014 02:33 AM
04-24-2018 05:05 PM
Greetings,
I was perusing the message boards, specifically the discussion on fitting multiple Gaussian peaks within a single spectrum, and I came across the response you posted. Just wondering if you still have the VI for such a functionality and if you would be willing to share it.
Best,
Stuart