06-16-2013 01:37 PM
I have a spectrum which has five gaussian functions. but I have to extract this Gaussian functions from the spectrum. There are diferent gaussian functions. What are the possible methods for extracting the gauss functions using labview. I have attached a picture to give you a picture. The solid line is the one I have and the dotted lines are the individual Gaussian function which will be extracted.
Note: the Gaussian function center number and width are known.
06-17-2013 08:21 AM
Please everyone i need your help. any suggestion will help me.
06-17-2013 09:32 AM
How exactly is this spectrum of five gaussain functions being imported into LabVIEW? It would helpful to get a better understanding of how your application is being implemented. If you do already know the b and c parameters, perhaps we can utilize the Peak Detector VI to extract the a parameter and then generate the appropriate function. This is just a preliminary guess, as some more information into your application would be helpful.
06-18-2013 02:27 AM
Hey Daniel K.
Thank you for the reply. I have attached the data i have which is a text file. I have to extract 5 gaussian functions from that spectrum.
06-18-2013 09:05 AM
Let me get this straight.
You have:
The experimental data set (spectrum)
The number of Gaussian curves you want to use for your curve fit
The center positions and variances for all of your Gaussians
You need:
The height of the Gaussian curves
Is that it? If so, all you need to do is set up an optimizing routine, using some measure to optimize (i.e., sum of abs(residuals) or residuals squared for each data point) and the acceptable final error for your solution.
A modified Simplex routine should work well, there may be others which would be more efficient, but you're talking about a trivial amount of comkputer time unless you have a gazillion of these spectra to fit.
If that is not your problem, please describe exactly what data you have and what you need to calculate more fully.
LabVIEW can use essentially any method for solving this problem that any other computer language can, but it is not likely to be a simple canned plug-in (at least it won't be one which you get in the vanilla version of LabVIEW), you'll have to put it together yourself.
Cameron
06-18-2013 09:27 AM - edited 06-18-2013 09:31 AM
Well, this is a simple nonlinear fitting problem.
Create a model function that calculated the composite spectrum from the parameters of the five gaussians (positions, widths, amplitudes (or areas, etc). Using reasonable initial guesses, apply a nonlinear curve fit and you should get all unknowns.
Be aware that the the solution will not be unique, for example swapping the parameters of gaussian #1 with gaussian #3 would give an equally good fit. ALso, if you start far from the solution, it might not converge right.
06-21-2013 09:30 AM
thank you for the replay Altenbach, but the solutions has to be unique. I hav posted the datas as attachemet check it. and if you have another solution for unique peaks, plese.
06-21-2013 09:34 AM
Thank you for the replay camerond. You exactly understood it. i didn't understand your method fully but
i have attached the expermental data set, above
the number of gaussian curves is four.
center positons: 3224, 3280, 3480, 3518 and variances 82.8, 64, 40 , 40 respectivily. and i want the height of this gaussian functions.
Hope this will give you a more clear picture.
Hoping to hear from you soon.
Thanks
06-21-2013 10:47 AM
@zola1024 wrote:
the number of gaussian curves is four.
center positons: 3224, 3280, 3480, 3518 and variances 82.8, 64, 40 , 40 respectivily. and i want the height of this gaussian functions.
Hope this will give you a more clear picture.
If you know the positions and widths exactly (and they don't need to optimized, i.e. you are only looking for the amplitudes!), the problem is trivial and can be solved using "general linear fit". Create a 2D matrix ("H") that contains unit gaussians at these four positions. The solution will be the four amplitudes you are looking for.
Check the help. Let me know if you have problems implementing that.
06-21-2013 10:56 AM
LabVIEW has an example solving a similar problem.
C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\math\curvefit.llb\Fit sum of 3 Gaussians with offset.vi