Peak Fit Parameters for EMGPeak and Voigt

Hi,

In the multipack fitting reports there are values for FWHM and area for the Exponentially modified Gas and the Voigt peak, but they do not directly match to the coefficient waves that are calculated unlike the Gauss and Lorentzian.  Can you share how those figures of merit are calculated from the coefficient wave.  I am trying to automate some peak fitting and reports and need to include those values.

Andy

For each of the peak shapes, some of the outputs are direct fit coefficients, and some are computed after the fit is done. In fact, none of the peak shapes that ship with MPF output FWHM directly. For some there is an analytic expression for it, but in the case of EMG, it has to be computed numerically. To find the peak amplitude and peak location, EMG uses the Optimize operation. To find the FWHM, it uses the amplitude from Optimize along with FindRoots to find the half-amplitude on each side of the peak.

You don't say much about what you are doing- are you using MPF2_AutoMPFit() to do batch fitting? If so, there is an optional input, "doDerivedResults" that requests that the batch results include the extra outputs. If you are not using MPF2_AutoMPFit(), take a look at doMPF2DerivedResults(), which is the function that does what doDerivedResults requests. That function isn't intended to be used in user code, so it may be difficult to figure out how to use it.

Hi John,

Thank you for the clarification.  For workflow reasons. some of which are too silly to put online, I have shied away from MPF2_AutoMPFit(). As an alternative solution since I have a handcrafted fit function, I am working with the peak fit curves and numerically calculate, FWHM and area.  It seems to work.

Andy

Note that you can also directly access the internal functions calculating these derived values from Multipeak Fit. This way you can directly benefit from hours upon hours for hair pulling to figure this stuff out. For this, you just need to ask the respective "_PeakFuncInfo" function. I use the Voigt peak shape as example below.

Grab the function name and number of parameters for the derived-parameter function:

String paraFunc =  Voigt_PeakFuncInfo(PeakFuncInfo_ParameterFunc)
String paraNames = Voigt_PeakFuncInfo(PeakFuncInfo_DerivedParamNames)
Variable paraCount = ItemsInList(paraNames)

In this case the function name will be 'VoigtPeakParams()'. You could write general code using something like FuncRef (this is what happens inside MPF) or just note down the specific functions you want to use. Now create the output wave and call the function:

Make/O/D/N=(paraCount,2) output
VoigtPeakParams(CoefficientWave, M_Covar, output)

In the output wave, the derived values are in the first column and derived errors are in the second column. Refer to paraNames to figure out which value is in which row, but the first four are usually Location, Height, Area, and FWHM.