Limitations to Accuracy in Extracting Characteristic Line Intensities From X-Ray Spectra

The early development of quantitative electron probe microanalysis, first using crystal spectrometers, then energy dispersive x-ray spectrometers (EDXS), demonstrated that elements could be detected at 0.001 mass fraction level and major concentrations measured within 2 % relative uncertainty. However, during this period of extensive investigation and evaluation, EDXS detectors were not able to detect x rays below 1 keV and all quantitative analysis was performed using a set of reference standards measured on the instrument. Now that EDXS systems are often used without standards and are increasingly being used to analyse elements using lines well below 1 keV, accuracy can be considerably worse than is documented in standard textbooks. Spectrum processing techniques found most applicable to EDXS have now been integrated into total system solutions and can give excellent results on selected samples. However, the same techniques fail in some applications because of a variety of instrumental effects. Prediction of peak shape, width and position for every characteristic line and measurement of background intensity is complicated by variations in response from system to system and with changing count rate. However, with an understanding of the fundamental sources of error, even a total system can be tested like a “black box” in areas where it is most likely to fail and thus establish the degree of confidence that should apply in the intended application. This approach is particularly important when the microanalysis technique is applied at lower electron beam voltages where the extraction of line intensities is complicated by extreme peak overlap and higher background levels.

The early development of quantitative electron probe microanalysis, first using crystal spectrometers, then energy dispersive x-ray spectrometers (EDXS), demonstrated that elements could be detected at 0.001 mass fraction level and major concentrations measured within 2 % relative uncertainty. However, during this period of extensive investigation and evaluation, EDXS detectors were not able to detect x rays below 1 keV and all quantitative analysis was performed using a set of reference standards measured on the instrument. Now that EDXS systems are often used without standards and are increasingly being used to analyse elements using lines well below 1 keV, accuracy can be considerably worse than is documented in standard textbooks. Spectrum processing techniques found most applicable to EDXS have now been integrated into total system solutions and can give excellent results on selected samples. However, the same techniques fail in some applications because of a variety of instrumental effects. Prediction of peak shape, width and position for every characteristic line and measurement of background intensity is complicated by variations in response from system to system and with changing count rate. However, with an understanding of the fundamental sources of error, even a total system can be tested like a "black box" in areas where it is most likely to fail and thus establish the degree of confidence that should apply in the intended application. This approach is particularly important when the microanalysis technique is applied at lower electron beam voltages where the extraction of line intensities is complicated by extreme peak overlap and higher background levels.

Introduction
The technique of x-ray microanalysis relies on the fact that if a flat bulk sample and a standard are exposed to the same beam current and in the same geometry relative to an x-ray detector, then C i /C i std = XRCF * I i /I i std (1) where C i and C i std are the mass concentrations of element i in sample and standard respectively, I i and I i std are the detected intensities of the characteristic line for element i in sample and standard and XRCF is the x-ray correction factor that accommodates the differences in x-ray generation, absorption, and fluorescence enhancement caused by the different overall compositions of sample and standard. In the two decades following Castaing's 1951 thesis [1], x-ray intensities were invariably measured with high resolution Bragg crystal "wavelength dispersive" spectrometers (WDS) so it was straightforward to measure I i . In this period, XRCF calculations were extensively investigated and reported at international conferences. Consequently, relative uncertainties of 2 % could be expected for x-ray microanalysis of bulk materials in a dedicated WDS electron probe instrument [2].
When energy dispersive x-ray spectrometry (EDXS) systems were first introduced, the inferior instrumental resolution was a barrier to accurate measurement of line intensities and EDXS was only used as a rough qualitative tool. However, in 1973 Reed and Ware [3] demonstrated that quantitative analysis of silicate minerals for elements with atomic number 11 and above could be achieved by EDXS with limit of detection around 0.001 mass fraction and with an accuracy equivalent to WDS. While other authors subsequently corroborated these accuracy claims (e.g. [4]), a survey of EDXS accuracy on a variety of instruments [5] showed that relative standard uncertainties of 6 % could be expected for major constituents and much higher uncertainties could be obtained for concentrations below 0.2 mass fraction. This early report suggested that the source of error was primarily deconvolution of overlapping peaks and background correction.
Spectrum processing and EDXS instrumentation in general have undoubtedly improved since that survey, particularly in terms of convenience of use and operator deskilling. "Standardless" analysis has become popular because the requirement to maintain a collection of analytical standards for intensity comparison is a major overhead. Although some systems provide an option to use a single reference standard so that an analytical total can be obtained, most standardless procedures normalise the results. Although normalisation conveniently overcomes problems of beam current fluctuation, analytical errors are concealed beneath a total that is always unity. A recent report reviews the performance of some standardless EDXS solutions showing error histograms for analysis of a set of known materials [6]. While the commercial systems with fitted standards achieved relative standard deviations of around 12 %, a first principles approach gave a relative standard deviation of about 25 %. In the samples used, the XRCF 's were well known, all concentrations were above 0.05 mass fraction and most were above 0.20 mass fraction so the uncertainty due to background subtraction was not an issue. Standardless analysis requires more accurate spectrum processing and detector modelling because it does not benefit from the cancelling of first order error terms and implicit instrument calibration that occurs when ratioing measured intensities from sample and standard as in Eq. (1).
In the early work on quantitative EDXS and in the above assessment of standardless accuracy [6], the lowest energy line used was close to 1 keV. Most EDXS systems are now capable of detecting x rays well below 1 keV and the advantage of reduced analytical volume provides an increasing attraction to work at low beam voltages [7]. However, the poorer line energy separation, increased incidence of peak overlap, and higher back-ground provide severe challenges for spectrum processing at these low energies. The low energy region also suffers electronic artifacts, incomplete charge collection (ICC) distortions of peak shape and large absorption edges in the background.
The successful early usage in mineralogical analysis, the sophisticated appearance of modern software, and the perceived security of a unity total provided by normalisation, have led to the expectation that all EDXS systems are capable of accurate quantitative analysis. However, with the increased application of standardless analysis, "out-of-the-box" with no customised installation, results are vulnerable to error, particularly when microanalysis is used outside the well-investigated territory of 1 keV to 10 keV energy and 15 kV to 25 kV accelerating voltage. This paper will demonstrate fundamental sources of error, how to avoid or overcome them and some approaches to validate overall spectrum processing performance for a "black box" system where the details of implementation are unknown to the operator.

Required Accuracy
Spectrum processing requirements are illustrated by Fig. 1. At 20 kV, the K lines of Ti, Cr, Mn, Fe, Ni are excited and clearly visible in the spectrum between 4 eV and 9 keV. The background is fairly flat and there is some K␤/K␣ overlap to contend with, but most algorithms will have no difficulty in revealing K␣ line intensities. However, Fig. 2 shows that when the same sample is excited at 5 kV, the spectrum processing task becomes formidable. The L line series for Ti, Cr, Mn, Fe, Ni all overlap, and the background bulges beneath the peaks so that a simple linear interpolation would give large percentage errors in composition.  The accuracy required in background correction can be understood with reference to Fig. 3. Whereas the bremsstrahlung background forms a smooth continuum with count rate per unit energy interval that is practically independent of detector resolution, the intensity within a single characteristic emission line is smeared into a peak with full width at half maximum (fwhm) determined by detector resolution so that the peak height is inversely proportional to resolution [see Eq. (7)]. The spectral response in Fig. 3 has been calculated for a typical Si(Li) detector with fwhm = 133 eV at 5.9 keV. Samples with higher atomic number generate proportionately more bremsstrahlung background and three examples are shown. Characteristic x-ray intensities depend mainly on element concentration and several K Fig. 3. Bremsstrahlung background contribution detected at 40Њ takeoff-angle for a flat sample bombarded by 20 keV electrons. Backgrounds for pure C, Fe, and Au are shown (Z = 6,26,79) together with a series of characteristic K peaks for various elements showing the size of peak that is obtained at 0.01 mass fraction concentration for a Si(Li) detector with resolution 133 eV fwhm at 5.9 keV. lines from different elements are shown at the 1 % level for reference. If the sample has a light matrix like C then the total background at any energy is much less than 1 % of the K␣ peak height for a pure element. If the sample has a heavier matrix like Fe, then the background level represents about 0.01 mass fraction concentration and for samples with particularly heavy matrices like Au, the background can be equivalent to a mass fraction of several percent at higher energies. Therefore, to detect elements at the 0.001 mass fraction level using K lines, the estimate of background will usually have to be accurate to well within 10 %. If other lines are used, any error in the background correction has a greater effect because the peak height for L or M lines is less than for K at the same concentration, as shown in Fig. 4. At low kV, background correction has to be more accurate because the background represents a much higher mass fraction as can be seen by comparing Fig. 3 with Fig. 5. At 5 kV, for a sample with matrix atomic number of about 26, the background height at 2.6 keV is equivalent to about 0.03 mass fraction of ClK␣ and this is five times greater than at 20 kV. Moreover, fewer K lines are excited at low kV and lower intensity L lines have to be used. Now the background height from an Fe matrix is equivalent to almost 0.10 mass fraction concentration for FeL. At 5 kV beam voltage, a background correction accurate to within 1 % is therefore required to detect Fig. 4. Relative intensities of x-ray lines excited in bulk pure elements at 20 kV for a Si(Li) detector with resolution 133 eV fwhm at 5.9 keV. The maximum peak intensity for K, L, and M series lines is shown as a function of x-ray energy to demonstrate that for the same concentration level, M and L lines are less intense than K lines. elements at the 0.001 mass fraction level using L lines. The bremsstrahlung shape for Fe in Fig. 5 also demonstrates the type of large step over the LIII absorption edge that makes background prediction particularly difficult at low energies.

Interpolated Background
Interpolation and extrapolation techniques are described in detail in Ref. [8]. At higher energies where the background is fairly linear, subtracting an interpolated background is a reliable method to determine the area of an isolated peak. Figure 6 shows one approach that simplifies the equations. If we take the sum of (2M + 1) channels straddling the peak and define two background regions of N channels exactly the same distance away from the peak centre, then the formula for the net window integral, P , is: The standard deviation, P is given by and this is minimised by choosing a large number of background channels N . In practice it is not easy to extend N indefinitely because of nearby peaks. In Fig. 6 the background window clearly needs to be far enough away from the nearby FeK␤ peak just above 7 keV. The net integral P is proportional to peak area but the pro- portionality constant cancels when making comparisons from sample and standard as in Eq. (1). However, for standardless analysis, the proportionality constant has to be determined and will be altered if detector resolution changes for any reason.

Digital Filtering
Rather than measuring the net window integral, the average peak intensity over (2M + 1) channels can be used and the average background subtracted thus: This can be regarded as a weighted sum of channel counts where the channels over the peak are each multiplied by 1/(2M + 1) and the background channels multiplied by Ϫ 1/(2N ) before summing. If the peak channels touch the background channels, then a graph showing the positive and negative weighting coefficients has a "Top-Hat" shape ( Fig. 7). This "Top-Hat" can be positioned anywhere in the spectrum to calculate the net peak intensity at that position. If this is done for every channel position in the spectrum, the net peak intensity at each channel is effectively the output of a digital convolution filter. If 2M + 1 is chosen to be close to the fwhm of a peak and 2N covers roughly the same number of channels, then the filter will remove any background that is linear over the range of the top hat and will emphasise peaks. Figure 8 shows the result of running such a filter along the biggest of the background curves shown in Fig. 3. The K peaks at 0.01 mass fraction concentration have also been filtered the same way and it is clear that the residual background after filtering is equivalent to much less than 0.001 mass fraction every-  where in the spectrum except in the vicinity of the AuM absorption edge near 2 keV and the AuN edges below 0.5 keV. The filtering operation converts Gaussian peaks into peaks with negative side lobes but the filtered shapes can still be used in a least squares fitting procedure [9,10]. No background points have to be selected, the method is immune to any smooth background artifact such as backscattered electrons or pile up continuum and no prior knowledge of sample, geometry or microscope parameters are needed in order to make a background correction. The technique therefore has widespread applicability and has been used successfully in commercial EDXS systems for more than 25 years.

Background Modelling
A drawback with the digital filtering approach is that it cannot separate high background curvature from the curvature of a peak and this is particularly apparent in the vicinity of absorption steps as demonstrated in Fig.  8. Even in this rather extreme case, the measured peak will only suffer a maximum 0.003 mass fraction equivalent error if it is in a particular energy position relative to the AuM absorption edge. Nevertheless, accuracy can sometimes be improved by exploiting more prior knowledge of the background shape.
If the sample is flat, homogeneous, and semi-infinite, the beam voltage is known and an estimate of composition of the specimen is available, then the theoretical bremsstrahlung background, B E , for a single channel at energy E , can be calculated by including terms for sample and detector effects: After computing B E for every channel in the spectrum, the result is convolved with a Gaussian function where fwhm varies according to the detector resolution as a function of energy (see Sec. 3.3). Detector efficiency is straightforward to calculate but is a source of error because usually only nominal data are available for window thickness and composition, there are manufacturing variations from window to window and there may be additional absorption if a thin layer of oil has condensed on the window, or ice has built up on the crystal surface. The other major source of error is in the generation term. Various authors have shown that the standard "Kramers" generation term Z is the mean atomic number of the specimen, E 0 is the energy of incident electrons, and E is the energy of the radiation, does not fit observed spectra very well. Lifshin [11] found that adding an additional quadratic term. K 2 и Z и (E 0 Ϫ E ) 2 /E provided a considerably better fit to the distribution as a function of energy. This observation was exploited in the popular "FRAME" public domain software where measurements at two background energies were used to determine K 1 and K 2 [12] and this has also been adopted in some commercial EDXS systems. If the "Kramers" term is regarded as the "theory" then including a quadratic term is equivalent to modifying the theory with a multiplier that varies with energy thus: where a and b are constants which force the theoretical B E to match the observed background at two chosen energies. This procedure can then be used to improve the fit for any theoretical bremsstrahlung formulation. Figure 9 shows a theoretical background that has been fitted to a spectrum of pyrope garnet at 2.16 keV and 8.14 keV. The fit between 3 keV and 8 keV is clearly very good and in general the modelling approach works well above 3 keV where absorption effects are slight. At lower energies uncertainty in detector efficiency is a problem and the correct estimation of absorption effects, (absorption) E in Eq. (5), requires the composition to be known and this has to be determinated by iteration. To do this, major elements must first be correctly identified and if a peak from an element like Si is misidentified as a much heavier element like W or Ta, then the calculated background shape will be incorrect. Another difficulty is that peak-free background points have to be found for fitting, ideally either side of every cluster of peaks. To identify whether a peak is present typically requires a region at least 4 ϫ fwhm in width to do a background subtraction as in Fig. 6. At low energy, such regions are rarely available so the background has to be extrapolated from a fit at higher energies. In the straightforward example shown in Fig. 10, the background at Na is underestimated. Fitting at 2.5 keV would raise the level, and the error in predicting the background would exceed the statistical uncertainty at Na.  The points chosen for background fitting must be representative of the underlying bremsstrahlung background. Figure 11 demonstrates a bad fit to a spectrum of FeS 2 where the background has been fitted using points at 2 keV and 8 keV. The point at 2 keV is raised above the true background by a residual low energy tail on the SK␣ peak caused by incomplete charge collection (ICC); consequently the fit is poor both at low energies and above the SK peak. Whereas tailing is not present on every peak, this example demonstrates that difficulties arise with background modelling whenever there are smooth background artifacts that are not detected as peaks. In Fig. 12, the background model for the GaP spectrum fits well at all energies when points at 8 keV and 16 keV are used for scaling. In contrast, Fig. 13 shows a spectrum recorded from the same sample under the same conditions but using a detector with a defective electron trap. This time, when the theoretical model is force fit to the spectrum using the same points at 8 keV and 16 keV, the background estimate is very poor. In this case, the continuum due to backscattered electrons that enter the detector has raised the background at 16 keV above the underlying bremsstrahlung x-ray continuum.  Another potential source of a smooth background artifact is pile up which occurs at high count rates. Most EDXS systems are fitted with pile up inspectors that are fast and effective for high energy photons. However, lower energy photons are more difficult to detect in the presence of noise. Therefore, at high rates a pile up continuum can appear in the spectrum as a tail on the high energy side of peaks and a sum peak may appear at the end of the tail [13]. Figure 14 shows a good background fit to a spectrum from pure cobalt at a modest count rate. In particular, note the presence of a strong CoL peak well below 1 keV. When the pulse processor setting is switched to a shorter time constant and the beam current increased, the high count rate spectrum shown in Fig. 15 exhibits strong pile up effects involving CoL photons. As a consequence, the same background modelling procedure now gives a very poor estimate of background. Thus, background modelling can in principle produce the most accurate background correction but it is particularly sensitive to the choice of points for fitting. The digital filtering approach is less sensitive to smooth background artifacts and avoids the need to choose fitting points so has more widespread applicability and gives more reproducible results. Both approaches require considerable care in implementation.

Detection Limits
If a peak is isolated and on a fairly flat background as in Fig. 6 then the background can be fitted either side of the peak, interpolated, and subtracted to give a very accurate measure of total peak area. This is the ideal situation referred to in most textbook calculations of statistical detection limits. However, Figs. 10 to 15 demonstrate how systematic errors in background subtraction can exceed the statistical fluctuations from channel to channel. In addition, if peaks overlap, the background for a given peak is effectively raised by its neighbour. Not only does this worsen the statistical detection limit [14] but also any systematic error in overlap correction may become the limiting factor in reliable detection of low concentrations.

Overlap Factors
Isolated peaks are rarely found in routine analysis. For example, K␤/K␣ overlap of the transition elements is commonplace in analysis of steels and combinations such as WM/TaM/SiK, and PbM/SK involve closely overlapping lines. If overlapping peaks have at least some energy regions where there is no overlap, the interference can be dealt with using "overlap factors" [3]. To do this, a spectrum from a standard containing just one elemental peak is acquired, then the net window integral for this peak and all the other elemental peaks is obtained from this spectrum. Thus, the relative fraction of the window integral picked up in the energy windows for other elements can be determined. A complete matrix of factors can be constructed provided enough pure elements or simple compounds are available to obtain the factors for each element. When the unknown spectrum is recorded, the net integral in each energy window is equated to the sum of the window integral for the element of interest plus some fraction of all the other elemental peaks present. The set of simultaneous equations is solved to find the net integrals in the absence of overlaps.
The overlap factor approach avoids any detailed knowledge of peak shape but requires a considerable amount of experimental work to characterise a particular system. If the x-ray detector is changed, or the pulse processing time constant is changed, or the resolution, linearity, zero position, or calibration changes with count rate or degrades over time, then overlap factors will change and corrections will be biased. This is less of a problem in mineralogical analysis where count rates on different materials are similar and there are relatively few elements to consider for analysis. The approach is thus suited to dedicated analysis tasks involving a fixed set of known elements but generally gives a very poor result with severe overlaps such as PbM/SK, BrL/AlK or TaM/WM/SiK. For routine analysis of a wide range of materials, a much more flexible approach is required.

Least Squares Fitting of Experimental Profiles
When the profile for each elemental peak is known, least squares fitting can be used to find the best combination of profiles that match the sample spectrum [8]. Profiles can be experimentally determined using pure element or simple compound standards and the background is subtracted, either explicitly or by digital filtering with a zero-area correlator like the "Top-Hat" [9,10]. The sample spectrum also must have background removed by the same technique and the linear least squares algorithm will then find that combination of profile intensities that gives the minimum sum of squares of differences with the background-subtracted sample spectrum. A refinement to the technique is to give more weight to those channels where the statistical standard deviation is small and the overall statistical precision of the determined intensities can be calculated, even in the more complex case where digital filtering has been used [9,10].
Acquiring a comprehensive library of profiles for all elements involves a lot of time and expense. If x-ray detectors from the same manufacturing process have similar characteristics, then the same profile library can in principle be used with more than one detector. Thus, a set of "virtual standard profiles" can be provided as part of a packaged software solution provided there is some method for correcting for changing resolution and calibration from system to system. In practice, this can be achieved if the system noise is automatically monitored by the electronics; variations in electronic noise can then be corrected by convolving the spectrum and profiles with the appropriate Gaussian functions to bring them all to the same effective noise value. Similarly, zero and gain of the energy scale can be periodically checked using a suitable calibration standard so that the energy scales can be brought into register.

Calculated Peak Profiles and Incomplete Charge Collection
Stored experimental profiles effectively characterise the energy response of a particular detector but suitable standards are not always available for every element and profiles also have to be obtained for all the EDXS configurations that are to be used. In principle, a mathematical model can overcome these difficulties. To first approximation, the response function of an x-ray detector to monochromatic radiation of energy E is a Gaussian function, where x i is the energy corresponding to channel i and ⌬ is the channel width for the digitised spectrum. If the energy scale is assumed to be linear then where x 0 is the electronic zero and g is the gain. The peak resolution, fwhm E is given by where fwhm 0 refers to the electronic noise contribution and dispersion E is the detector contribution to spectral resolution. For an ideal detector, dispersion E 2 = k и E , where k is a constant (typically around 2.48 for Si(Li) if energies are all in eV). These approximations work quite well for x-ray detectors in the energy region 4 keV to 15 keV but incomplete charge collection (ICC) near the front contact of the transducer means that in siliconbased detectors, the response function can change significantly for x rays that are absorbed strongly in silicon. In practice this means for energies around 1.84 keV to 3 keV and for energies below 1 keV, ICC effects give peaks a low energy tail, shift the centroid below x E and make the peak broader than fwhm E [15,16]. Various theoretical models have been proposed and suitable formulae suggested for representing ICC distortion, [e.g., 17,18]. However, there is no one model that works for all detector designs and the nature and degree of ICC may vary from detector to detector because of changes in the manufacturing process [19] and may also be affected if there is any ice build up on the detector surface. To date, the IEEE "Peak to background" test, which ratios the height of the MnK␣ peak from an Fe55 radioactive source to the background level at 1 keV, is the only official standard pertaining to charge collection [20] but is a very poor measure of tailing. For example, Fig. 16 shows three spectra of FeS 2 taken at 20 kV with different x-ray detectors. In the detector showing the worst tailing on SK␣, IEEE P : B was 18 000:1 whereas the one with the least tailing gave P:B = 16,000:1. Either value would normally be regarded as an indicator of excellent charge collection and in this case, the better detector had a worse value of P : B . At energies > 3 keV, the degree of tailing is less because x rays penetrate deeper into Si and some of the effect of ICC can be taken into account by shifting and broadening a standard Gaussian function. However, some tailing remains and Fig. 17 shows that even with a good detector with ICC performance equivalent to the best in Fig. 16, the residual non-Gaussian tail component still represent of the order of 1 % of the main Ti K␣ peak. Tailing can be accommodated by a suitable modification to the shape model as shown in Fig. 17. Any uncorrected residual tail may appear in the results as spurious concentrations for elements not present in the sample. Furthermore, as shown in Fig. 11, a residual tail can affect accuracy of background subtraction if background modelling is used. Fig. 16. Spectra of FeS2 recorded at 20 kV with different detectors and scaled to the sulphur peak. The bremsstrahlung background level is just less than 2 % of the S K␣ peak height and the ICC tail contribution can be seen above the background.

The Effect of Inaccuracies in Position and Width
Even if the peak profiles include ICC, either because they have been recorded experimentally or have been accurately modelled, then the position and width may still vary due to instrumental effects. Peak position is normally easier to control and a good design with precision components can deliver stabilities < 0.01 %/ЊC for gain, g . However, stabilisation for zero, x 0 , is not available on all electronic pulse processors and the baseline may move with count rate, particularly if there are a lot of low energy x rays that go undetected by the electronic pile-up inspector [21]. The electronic noise, fwhm 0 in Eq. (9), will change with processing time constants used in the electronics and may also change with count rate. In fact some electronic processors have adaptive shaping that is designed to produce the best resolution possible for a given count rate [22]; this not only guarantees that resolution changes with count rate, but also introduces a weighted series of Gaussians with different fwhm 0 values into the peak shape model. Noise contribution to a detector may also change over time and be temporarily affected by electronic interference. It is therefore imperative to have a some method of correcting for inevitable changes in position and resolution.
The sensitivity to errors in position and width will now be established using the simplifying assumptions that peaks are simple Gaussians, that the background subtraction is perfect and that profiles are fitted to the data by weighted least squares. Figure 18 shows the result of fitting a profile with correct fwhm = 100 eV but shifted by 1 eV relative to a sample peak on a background of the same height (P /B = 1). The residual is obtained by subtracting the background and the fitted profile result. The residual shows a characteristic bipolar shape with lobe amplitudes of about 1 % of the original peak height for a positional error of 1 % of fwhm . The residual has close to zero net area so that the area of the fitted peak is still correct provided the shift is a small percentage of fwhm . Figure 19 shows the result of fitting a profile with the wrong width, fwhm = 103 eV, to a peak with fwhm = 100 eV on a background of the same height. The least squares algorithm guarantees that the residual has the minimum Fig. 18. Residual after fitting a profile shifted by 1 eV relative to a peak, fwhm = 100 eV, on a background of the same height. Fig. 19. Residual after fitting a profile 3 eV too wide to a peak, fwhm = 100 eV, on a background of the same height. White curve shows the zero area residual that would result if the fitted area were exactly correct. The area of the least squares residual is negative so the true peak area has been overestimated. weighted sum of squares but when the resolution is incorrect, the residual has net negative area. This means that even with an isolated peak and an easy background subtraction, the area (and therefore measured x-ray line intensity) will be overestimated when the profile used for fitting is too broad. In practice, there are likely to be both position and width errors and Fig. 20 shows an example where not only is the area of the peak overestimated, but also the residuals might be mistaken as small concentrations of elements with nearby peaks. Statistical weighting does have an influence on the sensitivity to error. If a peak is very small compared to the background, then statistical weighting is uniform and the results are the same as if no weighting was used. If the peak-to-background ratio is very high, then statistical weighting will force the residual to be small in the wings of a peak and this produces a different result. Other techniques for peak area measurement are affected to some extent by shift and width errors. For example, if a peak is integrated over an energy window close to fwhm in width, the area represents a certain proportion of the true peak area. If the spectrometer drifts or resolution changes, then this proportion will change.
In Fig. 21 the sensitivity to shift errors is compared for simple window integral and least squares fitting techniques. For an isolated peak, a small shift in position has hardly any effect on the measured area and even in the extreme weighted least squares case, a shift of 4 % of fwhm gives less than 1 % relative error in the measured intensity. In contrast, an error in peak width has a significant effect on peak areas as shown in Fig. 22. The case of weighted least squares with an isolated high peak on a low background will rarely occur so it is the curves for  the window integral method and for peaks on a high background that are more likely to be relevant to practical situations of analytical interest. These show that for a 4 % error in fwhm , the relative error in area is about 2 % and a useful approximation is that the relative error in measured area is about half the relative error in fwhm assumed for the peak.
A much more common and serious problem for EDXS is the case of overlapping peaks. When peaks are less than a fwhm apart, a small error in position will seriously affect the distribution of areas in the fitted result. For example, if there was a large peak near 1.75 keV in the spectrum and it was not known whether there was some Si or W present, two profiles would be fitted to the spectrum corresponding to the expected positions of SiK␣ and WM␣ which are 35 eV apart. Figure 23 demonstrates the effect of a positional calibration error on the fitted results when the true peak contains only WM␣. When there is no positional error then the result is the expected unity mass fraction for W, 0 for Si. However, if the profiles are both too high in energy, the W is underestimated and a spurious concentration of Si is reported. In these extreme overlap situations, a useful rule of thumb is that the spurious contribution as a fraction of the main peak is given by the ratio of Shift/ Separation. Thus, for two peaks separated by 40 eV, a shift error of 4 eV gives an error in area for both peaks equivalent to about 10 % of the main peak area. Therefore, in an even more extreme overlap example such as AlK␣/BrL␣, where the separation is only 7 eV, just a 1 eV error in position will produce errors equivalent to 14 % of the main peak area. Shift and resolution errors can still be a problem in more modest overlap situations. As Fig. 20 suggests, if there are any peaks within Ϯ 2 ϫ fwhm of a large peak, then the residual due to position or width errors can be picked up as spurious concentration. As shown in Sec. 2.4, background modelling is subject to errors particularly when suitable background points cannot be found near to the peak being measured. The digital filtering approach avoids this problem because the "Top-Hat" effectively makes a local background estimate very close to the peak. However, if there are errors in position or width, the sort of residual shown in Fig. 20 now influences the "Top-Hat" background estimate for nearby peaks so the influence of these errors extends to Ϯ 3 ϫ fwhm from the main peak. For example, MgK␣ and AlK␣ peaks are separated by 230 eV and if a trace of Mg is to be determined in the presence of a large Al concentration, then position and width errors can still be an issue if the fwhm exceeds 80 eV.

Nonlinear Fitting and Derivative Profiles
The discussion so far has assumed that peak width and position are predetermined in which case the least squares solution can be obtained in closed form without iteration. Position and width can also be included as parameters in a either a non-linear least squares fit by sequential simplex for example [23] or by including first and second derivative profiles in a linear fit [24]. However, if we let position and resolution vary without constraint, the best fit to the data can be obtained with combinations of position and resolution that do not correspond to the real solution [25]. This problem occurs because statistical noise can make it impossible to differentiate between plausible alternatives as the following example will demonstrate. Figure 24 shows a mixture of two Gaussian peaks, fwhm 100 eV, separated by 30 eV on a uniform background. This could correspond to a TaM peak next to a SiK peak for example and a representative level of statistical noise is shown. If the candidate peak profiles are allowed to shift along the energy axis while maintaining a constant separation, then another good fit is obtained with a shift of 13 eV as shown in Fig. 25. In this case, even though the fit is good, the peak heights are completely reversed and the fitted result for the left peak is now twice the height of the peak on the right! If the profile width is also allowed to vary, then another good fit can be obtained by fitting a single peak to the sum as shown in Fig. 26. In this case, if the sample did contain Ta and Si, the good fit with just a single peak would suggest that only one of these elements were present. Therefore, even qualitative identification of elements present would fail. Whereas varying position and width can be used to obtain a good fit to a single peak, it is not suitable for resolving severe overlaps. If there are always going to be strong isolated peaks present in the spectrum and only x 0 , fwhm 0 and g are varied in the fitting procedure, then the dominant peaks will effectively provide an internal calibration and constrain the fit to provide sensible solutions [26]. However, in low kV spectra in particular, there are unlikely to be any strong isolated peaks. Furthermore, if the spectrum contains only a few counts, non-linear methods will not converge on any sensible result because residual errors in the fit will be totally masked by statistical noise. Therefore, for an entirely general solution to microanalysis, a reliable energy calibration and specific measurement of resolution are required in order to overcome the accuracy barriers described in Sec. 3.4.

Calibration Requirements
If a Gaussian peak is on a low background, the background can be subtracted by linear interpolation and a quadratic curve fitted to the log intensity by weighted least squares using all points above 10 % of peak maximum. Thus, Eq. (8) can provide estimates for x E and fwhm E . If the area of the peak is N counts, then the standard deviation in measured position is approximately x = 0.43 fwhm E /sqrt (N ) and the standard deviation in measured resolution is approximately fwhm = fwhm E /sqrt (N ). (These values have been confirmed by simulation and are close to the precision obtainable using the full peak [27]). With two Gaussian peaks, A and B corresponding to energies E A and E B , the fitted values of position, x A and x B can be used to determine x 0 and g using Eq. (8). Then the predicted peak position for a line at energy E will be where p = (E Ϫ E A )/(E B Ϫ E A ). The standard deviation in this predicted position will then be For EDXS systems without an automatic zero measurement, calibration requires a spectrum with two well defined x-ray peaks of similar area, usually AlK␣ and CuK␣ at 1.49 keV and 8.04 keV. If a spectrum with 300 000 total counts is recorded at 20 kV from a typical Si(Li) detector with fwhm = 133 eV at 5.9 keV and there are 50 000 counts in each peak, then the precision in calibration at energy E will from Eq. (11) be Ϯ 0.19 eV at the OK␣ energy. Some EDXS systems have an automatic "strobed" zero energy measurement which effectively provides a reference peak corresponding to zero energy. Therefore, calibration can be achieved using a spectrum with just a single x-ray peak. If this is CuK␣ and has 100 000 counts (again assuming a total spectrum area of about 300 000 counts) and the strobe zero peak has an area of 100 000 counts, then the precision in calibration at energy E will be Ϯ 0.07 eV at the OK␣ energy. Resolution calibration is achieved in a similar manner where fwhm A and fwhm B are used to determine fwhm 0 and k using Eq. (9). Using standard methods for error propagation, standard deviation for the predicted fwhm at energy E will be Using the same example with a total spectrum area of 300 000 counts the relative uncertainty in fwhm for OK␣ would be 0.89 % for the method using AlK␣ and CuK␣ peaks with 50 000 counts and 0.24 % using strobe zero peak and CuK␣ peak of 100 000 counts.
Given the magnitude of effects demonstrated in Sec. 3.4, it would appear that calibration for position and resolution should not be a barrier to accuracy provided a suitable standard is used and at least 300 000 counts are acquired in the calibration spectrum. If the temperature changes by only 1 ЊC after the calibration, positional errors could typically be 1 eV or more. Although some sophisticated electronic designs claim high stability, in many systems, variation in position and resolution can be as much as 5 eV between low and high count rate and some electronic designs may also be sensitive to the balance of low and high energy x rays in the spectrum. Consequently, position and resolution errors are more likely to be dominated by instrumental effects rather than the counting statistics for calibration described by Eqs. (11) and (12). Figures 14 and 15 indicate how the measured spectrum may change when count rate or electronic processor settings are altered. As well as background artifacts, peaks may shift in position and resolution may deteriorate at high count rates so that any calibration performed at low count rate or a particular processor setting may become invalid at higher count rates or a different setting. Figure 16 points out some of the variability in ICC that may be seen from detector to detector so that even at low count rates, the same software and procedure may produce different results with different detectors. Complete EDXS analysis systems are designed for ease of use and it is often difficult to get access to individual components to make specific tests. Furthermore, manufacturers may include specialised correction software to correct for certain types of instability and variation. Often the only way to test for stability and reproducibility is to treat the total system as a "black box" and validate it in real situations that are representative of the analytical problems to be tackled. There will always be some statistical fluctuation in results due to the operation of subtracting background so that both positive and negative results are to be expected for any element with zero concentration. Any system that does not report small negative concentrations should therefore be treated with suspicion. Usually, tests similar to the following can be performed on any EDXS system and can be adapted to suit the particular application.

Total System Stability and Reproducibility
A severe test of spectrum processing is to acquire a spectrum from a sample of Al or Al 2 O 3 and force the system to analyse for MgK, AlK, SiK, and BrL . Of course, only Al should be detected, but any error in background modelling or overlap correction will show up as spurious concentrations of Mg, Si, and Br. Since BrL is only 7 eV apart from AlK, this test is extremely sensitive to peak position accuracy whereas Mg and Al provide a check for less severe overlaps. Table 1 demonstrates the test in use. Analysis of an Al 2 O 3 sample has been performed at different pulse processor settings and at a variety of input count rates. The statistical errors reported by the software package are shown next to each analysis result. Both positive and negative results are reported and any result within Ϯ 3 standard deviations could reasonably be regarded as the result of statistical variation. However, the 35 kcps result at PT3 shows some significant spurious concentrations of Mg, Si, and Br.
The Al/Br overlap is particularly severe but is typical of the L/K overlaps that occur at low energies such as Ti/O, V/O, Cr/O. A less severe test is to use a sample of pure Si and analyse for WM, SiK, TaM, checking for spurious amounts of W or Ta. In this "null" testing approach, it is essential that the system reports the results for all elements and their standard deviations. Then it is possible to establish what the real limit of detectability is for a low concentration of any element. As Fig. 2 shows, analysis at low kV presents a severe challenge for any EDXS system but again, null tests can easily be devised to establish how effective spectrum processing is under these conditions. Even if peak intensities can be determined with some confidence, there is no guarantee that chemical effects will not affect XR-CFs and some testing with representative compounds is always desirable. While it is important to explore and gain confidence in all likely analytical configurations, there is little point in pushing the EDXS to extremes that are never likely to be used.

Conclusions
Some time in the future, spectrometers may have sufficiently good resolution to leave some background between every characteristic line so that simple interpolation could be used to obtain peak areas and this would be insensitive to peak shape and position errors. Meanwhile, all current EDXS systems have to cope with peak overlap and whatever the sophistication in spectrum processing algorithms, the following factors always affect accuracy in determining characteristic peak intensities: 1) Prediction of peak shape, width and position for every characteristic line 2) Measurement of background intensity 3) Stability of spectrometer characteristics with time and changing count rate Accuracy with relative errors less than 2 % for major constituents (mass fractions greater than 0.1) and errors less than 0.001 mass fraction at low concentrations can usually be achieved by restricting count rates to below 3 kcps, selecting specific elements on the basis of prior knowledge of the sample, working at 15 kV or higher so that the well-separated K lines for transition elements are available, avoiding analysis of any line below 1 keV in energy and making regular checks of energy calibration and beam current. To achieve this accuracy beyond this restricted range of application, particularly towards low keV, requires excellent electronic and detector stability and improved methods for modelling peak and background shape.