PeakFucntions2 Gauss Peak Function Help
n.black
I've been writing a batch curve fit procedure using the MPF2_AutoMPFit() function.
I'm fitting gaussian peaks.
My resultant Peak Coefs wave, w, has w[0]=location, w[1] = mystery, w[2] = height.
I see that the three coefficients are related as follows: (form the PeakFunctions2.ipf)
Function GaussPeak(w, yw, xw)
Wave w
Wave yw, xw
yw = w[2]*w[1]*SqrtPi*gauss(xw[p], w[0], w[1]/sqrt2)
end
Wave w
Wave yw, xw
yw = w[2]*w[1]*SqrtPi*gauss(xw[p], w[0], w[1]/sqrt2)
end
I also see that there Gauss(r,c,w) function is different from the Gauss1D(w,x) which I'm a lot more familiar with. It states in the fitting procedure that default gauss peak is more accurate than the Gauss1D(w,x) version which I'm guessing is due to the iterative procedure which calculates the fit.
So the my questions are:
1) what is w[1]? It must be related to the width in some way?
2) How can I use these peak coefficients to calculate the FWHM of my fitted peak?
3) As a bonus can I calculate the peak area using these coefficients?
As using the MPF2 package outputs these results I'm sure there must be a way to use the already written functions in my batch procedure to extract the relevant data. Ultimately I'd like to have the peak position, peak height, peak FWHM and as a bonus peak area.
Thanks for your help!
Nicola
So location = w[0], amplitude=w[2], width (i.e., sigma of the normal distribution represented by the peak * sqrt(2))=w[1], FWHM=width*2*sqrt(ln(2)), and area=amplitude*width*sqrt(Pi).
June 3, 2018 at 02:42 pm - Permalink
Thanks for your reply. That really helped me out. It turns out the reason I couldn't get my numbers to calculate a FWHM from the width was due to my inability to press enter on my computer's calculator!
I've just gone through the numbers again (using my calculator correctly) and it works fine. It's times like these I miss my casio.
Thanks for your help! I was convinced I was going mad for a bit there.
Nicola
June 4, 2018 at 02:11 am - Permalink
The mysterious coefficient is, indeed, a version of the width. It is- get ready for this- sqrt(2)*stdev. This peculiar formulation has its roots in Igor's misty history from 30 years ago when floating-point computations were very slow...
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 4, 2018 at 09:42 am - Permalink
Then maybe I have just the thing for you: http://www.igorexchange.com/project/CalcPad
:)
June 4, 2018 at 10:08 am - Permalink
http://www.igorexchange.com/node/4395
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
June 5, 2018 at 03:32 pm - Permalink