International
Tables for Crystallography Volume I Xray absorption spectroscopy and related techniques Edited by C. T. Chantler, F. Boscherini and B. Bunker © International Union of Crystallography 2024 
International Tables for Crystallography (2024). Vol. I. ch. 5.2, pp. 636638
https://doi.org/10.1107/S1574870722003962 Oversampling and conversion to kspace^{a}Department of Physics, Illinois Institute of Technology, Chicago, IL 60616, USA Methods of converting Xray absorption finestructure (XAFS) data to kspace are described. Keywords: XAFS; sampling; resampling; rebinning; Fourier; Nyquist. 
Basic overviews of Xray absorption finestructure (XAFS) data acquisition can be found in Stern & Heald (1983), Koningsberger & Prins (1988) and Bunker (2010). The visualization and processing of extended Xray absorption finestructure (EXAFS) data are aided by conversion of the absorption data from energy space, in which the data are represented as a function of photon energy E, to kspace, in which the data are represented as a function of k, where the wavevector magnitude k = p/ℏ = [2m(E − E_{0})]^{1/2}/ℏ ≃ [0.2625(E − E_{0})]^{1/2} in eV Å units, p is the momentum and m is the electron mass. Representing data in this manner naturally displays the sinelike nature of EXAFS oscillations in kspace, and it is a necessary step for the subsequent use of Fourier transformation and filtering. Conversely, in Espace the data oscillate more slowly as the energy increases above the edge, which partially obscures the information content of the EXAFS.
Data are usually acquired as a function of energy. The nearedge data must be acquired on an energy grid that is sufficient to resolve Xray absorption nearedge structure (XANES) and preedge features, so the sampling interval should be several times smaller than the combined corehole broadening added in quadrature with the monochromator resolution. The following discussion refers to the extended (EXAFS) region, where it is essential to sample (measure) the EXAFS data on a sufficiently fine energy grid that the highest frequency oscillations in the data are accurately represented. Although some dataacquisition software is set up to acquire data points on a uniform grid in k, which decreases the density (in energy space) of sampling points as E increases, other software divides the data into energy regions with different sampling densities. Still other software, for example continuousscan XAFS (QXAFS; Frahm, 1988), may acquire data on an approximately equal density grid in Espace. These data must be converted into kspace, maintaining a sufficient sampling density in k to accurately represent the signal. Appropriate averaging by rebinning helps to preserve the statistical weight of data points, as described and illustrated below. Rebinning is supported by popular EXAFS dataanalysis programs (see, for example, Ravel & Newville, 2005; Newville, 2013) or it can readily be carried out by other means, as shown below.
As discussed more fully elsewhere in this volume, the Nyquist sampling theorem indicates that in order to accurately represent a bandlimited signal (i.e. one whose signal content strictly lies within a definite frequency band), the highest frequency component that is present in that signal must be sampled at least twice per oscillation of that component. If it is not sampled frequently enough, the highfrequency components will alias to (appear as) lower frequency components, which misrepresents the information content of the signal. The Nyquist frequency is π/(2R_{eff}) for an EXAFS signal corresponding to a path of effective distance R_{eff}. For R_{eff} = 4 Å this would imply a theoretical minimum spacing between data points of δk ≃ 0.4 Å^{−1}. In practice it is desirable to oversample the data by at least a factor of 8, giving δk ≃ 0.05 Å^{−1} or less. This more accurately represents the signal waveform and reduces the aliasing of highfrequency noise, which would otherwise masquerade as the desired lower frequency signal.
It is straightforward to convert the independent variable from E to k simply by the mathematical transformation given above, but one still has to change from the initial energy grid to the desired kgrid. This involves interpolation of the data set, which can be accomplished by various means, such as cubic spline, Lagrange or Hermite interpolation. Interpolation uses data samples at values of k that are not generally on the desired grid to estimate what the signal would be at points on the desired kgrid. This is an approximate process, and it is important to use a sufficiently fine kgrid spacing (i.e. 0.05 Å^{−1} or less) on which to interpolate in order to adequately sample the peaks of the oscillatory waveforms, otherwise the envelope of the waveform (the amplitude of the oscillations) will be underestimated because the probability of a grid point landing on the maximum or minimum values of the waveform is smaller with fewer grid points. The interpolation does not `know' the original waveform so the amplitude will normally be underestimated.
In data analysis the spectra are normally weighted with a power of k, typically k^{2} or k^{3}, to make the 40EXAFS spectrum more constant in amplitude in order to better resolve Fourier transform peaks and to provide more consistent weighting of the data in backgroundsubtraction and fitting procedures. The data are, however, subject to noise from various sources, such as counting statistics and electronics. When the data are weighted by k^{2} or k^{3}, this noise is greatly enhanced at high k. To mitigate this, it is helpful to acquire the highk data with a longer integration time or with a higher density of data points, which are then signalaveraged.
Although interpolation provides some averaging effect, when converting data from E to k it is desirable to preserve the statistical weight of the data samples. For example, if the data are acquired (as in QXAFS) with an approximately uniform density (say 1 eV or less) in Espace, this results in a density in kspace that grows linearly with k, so that several (or many) measured points may correspond to a single point on the desired kspace grid, and these should be averaged to reduce noise. A simple and effective procedure is then to group together the points that map into each kspace grid interval (for example from k_{n} − δk/2 to k_{n} + δk/2) and then average their kvalues and corresponding signal values to produce a single averaged point with a kvalue that is close to the desired kgrid; these can then be interpolated precisely onto the desired kgrid with only small errors.
As a concrete example, we consider synthetic QXAFS data sampled uniformly in energy space on a grid of 0.5 eV from 15 to 1000 eV above the edge. The synthetic data are modelled as sin(2kR_{eff})exp(−2k^{2}σ^{2})/k^{2}, with R_{eff} = 4.0 Å and σ^{2} = 0.005 Å^{2}, and a normally distributed random variate of zero mean and standard deviation 5 × 10^{−4} is added to simulate noise; the result is then weighted with k^{3}. This models the effect of increasing noise level at high k. These data are then processed in two different ways: firstly, by rebinning, as described above, into bins of width δk = 0.05 Å^{−1} that are centred on the desired kgrid points; in Mathematica/Wolfram language, for example, this can be concisely performed with the code Mean/@GatherBy[data, 1 + Floor[(First[#]  kmin + dk/2)/dk] &], where the variable data is an array of {k, k^{3}χ} pairs, as mapped from the original energy grid, and kmin is the minimum value of k on the grid; the result is then interpolated onto the desired grid (Fig. 1). The second (simplistic) way omits the rebinning step: it just takes the data mapped from energy space to kspace and then interpolates the data to the desired kgrid (Fig. 2). The latter procedure gives results that are evidently much noisier than the data set produced by rebinning and averaging before interpolation; in this case, the standard deviation of the residuals (data minus exact data) of the rebinned and averaged data is less than 1/3 of the standard deviation of the data that were simply interpolated without rebinning (Fig. 3).

Synthetic QXAFS data with noise, rebinned before interpolation to the desired kgrid (data points are shown; the solid curve represents the exact data with zero noise). 

Synthetic QXAFS data with noise, interpolated to the desired kgrid without rebinning (data points are shown; the solid curve represents the exact data with zero noise). 
In summary, resampling from irregularly sampled data to the desired kspace grid can be performed reliably provided that the original grid is oversampled at several times the Nyquist limit, and rebinning/averaging is performed to preserve the statistical weight of the acquired data points.
References
Bunker, G. B. (2010). Introduction to XAFS. Cambridge University Press.Google ScholarFrahm, R. (1988). Nucl. Instrum. Methods Phys. Res. A, 270, 578–581.Google Scholar
Koningsberger, D. C. & Prins, R. (1988). Xray Absorption: Principles, Applications, Techniques of EXAFS, SEXAFS and XANES. New York: John Wiley & Sons.Google Scholar
Newville, M. (2013). J. Phys. Conf. Ser. 430, 012007.Google Scholar
Ravel, B. & Newville, M. (2005). J. Synchrotron Rad. 12, 537–541.Google Scholar
Stern, E. A. & Heald, S. M. (1983). Handbook of Synchrotron Radiation, Vol. 1b, edited by E.E. Koch, pp. 955–1015. Amsterdam: NorthHolland.Google Scholar