LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I extract a gaussian function out of a spectrum which has five gaussain functions....

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.

0 Kudos
Message 1 of 29
(7,420 Views)

Please everyone i need your help. any suggestion will help me. 

0 Kudos
Message 2 of 29
(7,370 Views)

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.

dK
0 Kudos
Message 3 of 29
(7,354 Views)

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.

Download All
0 Kudos
Message 4 of 29
(7,330 Views)

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

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 5 of 29
(7,310 Views)

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.

0 Kudos
Message 6 of 29
(7,302 Views)

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. 

0 Kudos
Message 7 of 29
(7,251 Views)

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

0 Kudos
Message 8 of 29
(7,249 Views)

@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.

 

 

0 Kudos
Message 9 of 29
(7,239 Views)

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

0 Kudos
Message 10 of 29
(7,231 Views)