Skip to content
Nathaniel Sherry edited this page Jan 16, 2026 · 7 revisions

Peakaboo employs characteristic models for each element to fit the K, L, and M peaks observed in XRF spectra. These models are based on physical data that describe the electronic transitions occurring during the XRF process. With default settings, each transition line is convolved with a pseudo-Voigt peak shape. Each pseudo-Voigt shape includes the energy loss broadening that contributes to most of the background that occurs in XRF spectra.

Escape Peaks

When fitting peaks in XRF spectra, the detector type significantly influences the spectral features. For instance, in a Silicon Diode Detector (SDD), interactions between incoming X-rays and silicon can emit Si K-shell electrons, creating escape peaks by reducing the X-ray's energy by 1.74 keV. Such escape peaks appear for major elements.

To tailor escape peak fitting to your detector, go to the menu-settings Advanced Options dialog. Under the Detector section, you can select Silicon or Germanium based on your detector type, or toggle escape peaks off if it is unnecessary. Silicon is the default setting.

Shape and Width of Fitting Curves

The characteristic XRF peak's curve shape (lineshape) is, by default, represented using a Pseudo-Voigt function, a mix of Gaussian and Lorentzian shapes. This choice offers a good balance between computational speed and accuracy, effectively handling peak tailing from scattering and detector effects.

In the menu-settings Advanced Options dialog in the Curve Fitting section, you can select the function for peak fitting. While the Pseudo-Voigt is the default for its efficiency, options for the slower, more precise Convolving Voigt, and the original Lorentzian and Gaussian functions are also available.

For detailed peak fitting, multiple functions overlay to represent the various transitions within each K, L, and M-shell XRF transition. To visualize these transitions within the composite lineshape, toggle menu-view View →  Transition Lines and each transition will be marked by a solid line, indicating its contribution to the overall peak shape

Spectral Fitting of multi element sample showing individual lines

Spectral Fitting of multi element sample showing individual lines

Solid-state detectors, such as the Silicon Diode Detector (SDD), produce spectra in which peak width combines a constant intrinsic width and fluctuations from electronic detector noise. To model the broadening introduced by different detectors, noise can be customized from the menu-energy Energy menu. Notably, the width of characteristic XRF peaks decreases linearly with increasing peak energy, a factor integrated into the fitting algorithm.

The database for peak fitting, including positions and relative intensities for each K, L, or M XRF elemental transition, is sourced from reputable tabulations to ensure accuracy and currency. The majority of fittings are based on the Xraylib project, supplemented by Krause’s contributions for high Z elements' K series transitions. These fittings are fine-tuned for 20keV irradiation.

Selecting Fittings

To fit your data, four different tools are available. Access these by clicking the add Add Fittings button located at the top of the Peak Fitting tab.

Element Lookup

The "Elemental Lookup" feature allows you to easily match K, L, or M lineshapes of known elements to peaks in your spectrum. Locate an element by scrolling or by filtering by its name or atomic symbol, then select the transition you wish to fit. Purple provisional lineshapes will appear on the spectrum, with the atomic symbol marking the most intense component. This visual aid assists in verifying whether the selected element aligns with the spectral peaks under examination.

If the provisional fit doesn't align, either click the cancel Cancel button to undo or deselect the element to adjust your selection. If the fit seems appropriate, confirm by clicking ok OK.

The elemental lookup fitting controls

The elemental lookup fitting controls

For optimal results, start fitting elements from those with lower atomic numbers, progressing to higher ones. Prioritize fitting K lines before L lines to avoid confusion from spectral overlaps. You can annotate the spectrum by double-clicking the element in the list, adding brief notes next to each elemental line label.

Guided Fitting

"Guided Fitting" helps identifying peaks by just clicking on the spectrum. To use it:

  1. Click on the desired peak. The software automatically fits it with a recommended element, showing other possibilities in a dropdown list on the sidebar.
  2. To fit additional peaks, click the add Add button below the list and select another peak.
  3. If you need to modify any fitting, use the edit Edit button.
  4. Once satisfied with the fittings, finalize by clicking ok OK to add them to your analysis.

The guided fitting controls

The guided fitting controls

Automatic Fitting

Automatic Fitting identifies intense peaks throughout the spectrum autonomously. Selecting this tool will propose fittings with identified elements. Approving the proposed fittings will add them to your list. This method offers a quick overview of the spectrum's primary components. However, you should always review the automatic selections to ensure their correctness and completeness.

Summation Peaks

"Summation Peaks" emerge when signals from intense XRF peaks arrive almost simultaneously, combining their energies into new peaks. By combining already-fitted elements from the Peak Fittings list, you can account for these combined energies, creating new, summed lineshapes on the spectrum for analysis.

The summation fitting controls

The summation fitting controls

Working with Fittings

In the fittings list, each entry has an associated checkbox to control its active status. Unchecking a box temporarily disables the fitting from the analysis, allowing for easy comparison or refinement of the spectral data. Re-enable the fit by rechecking the box.

When you select a fitting from the list, it's highlighted in blue on the spectrum. This visual cue is particularly helpful for distinguishing between overlapping peaks and understanding the composition of complex lineshapes.

Fitting Algorithms

Peakaboo provides several fitting algorithms to match theoretical lineshapes to your spectral data, accessible via menu-settings Advanced OptionsCurve Fitting. The options include:

  • Max-Under-Curve: The default choice, selected for its speed and conservative fitting approach, ensuring no over-fitting within the peak's dimensions. However, it may struggle with noisy or complex spectra.

  • Least Squares: Optimizes fit by minimizing the sum of squared differences between the fitting lineshape and the actual data, making it suitable for noisy data. Its drawback is a tendency to over-fit weaker signals.

  • Optimizing: A modified Least Squares algorithm that penalizes over-fitting, offering a balance between fitting noisy data well and avoiding fitting where there's no significant signal.

Comparison of mapping data treated with Max-Under-Curve (left) and Optimizing (right)

Comparison of mapping data treated with Max-Under-Curve (left) and Optimizing (right)

Multi-Element Fitting Solvers

In situations where spectral peaks from multiple elements overlap, it can be difficult to determine what signal came from which fitting. Peakaboo offers algorithms to resolve the signal contention, accessible via menu-settings Advanced OptionsOverlap Solving. Several approaches are available to deal with this complex fitting scenario:

  • Greedy: As the default solver, it quickly fits peaks from Curve Fitting in the sequence they appear in the Peak Fitting list, adjusting each curve based on the remaining spectrum after subtracting previously fitted curves. This method allows users to influence the fitting order by rearranging elements, helping to manage potential overfitting issues.

  • Optimizing: This enhanced Least Squares method fine-tunes the results of Curve Fitting and minimizes overfitting by penalizing fits against non-existent signals, offering refined solutions for spectra with dense overlaps. It's more comprehensive but slower than the Greedy solver.

  • MultiSampling: Building on the Optimizing approach, MultiSampling averages multiple fitting sequences to mitigate the influence of element ordering, enhancing reliability at the expense of increased computational demand.

Annotations

Each fitting you add can be annotated to track important context or caveats for your work. Annotations will be displayed with the fitting’s Element Name in the plot, and in tool tips in the Peak Fitting sidebar.

To add an annotation, double-click on the fitting in the Peak Fitting sidebar. A prompt will appear which will let you add an annotation to the selected fitting. It can be cleared by double-clicking the entry again and setting the

Suggestions for Successful Fitting

To achieve effective peak fitting in Peakaboo, consider the following strategies:

  • After energy calibration, use Automatic Fitting to quickly identify clear peaks. Then, refine with Guided Fitting and Element Lookup for thorough peak identification.

  • Watch carefully for summation peaks, especially under high photon flux with the SDD detector. If you find one, there are likely others. Using Summation Fitting can help account for these additional peak contributions.

  • Consider not using any background subtraction as it might alter peak shapes and affect precise fitting.

  • Aim for the summed fitted spectrum to closely align with the experimental spectrum, particularly in high-signal regions.

  • Minor adjustments to peak width settings (FWHM noise level) can enhance fitting, especially in response to changes in photon flux.

[1] M.O. Krause, C.W. Nestor, C.J. Sparks and E. Ricci, X-Ray Fluorescence Cross Sections for K and L X Rays of the elements, Oak Ridge Report ORNL-5399, 1978.

Clone this wiki locally