Simulations of x-ray speckle-based dark-field and phase-contrast imaging with a polychromatic beam

Following the first experimental demonstration of x-ray speckle-based multimodal imaging using a polychromatic beam [I. Zanette et al., Phys. Rev. Lett. 112(25), 253903 (2014)], we present a simulation study on the effects of a polychromatic x-ray spectrum on the performance of this technique. We observe that the contrast of the near-field speckles is only mildly influenced by the bandwidth of the energy spectrum. Moreover, using a homogeneous object with simple geometry, we characterize the beam hardening artifacts in the reconstructed transmission and refraction angle images, and we describe how the beam hardening also affects the dark-field signal provided by speckle tracking. This study is particularly important for further implementations and developments of coherent speckle-based techniques at laboratory x-ray sources.


I. INTRODUCTION
X-ray phase-contrast and dark-field (or visibility-contrast) imaging have proven to be reliable imaging methods and are used, in particular, in cases where conventional absorption contrast can only yield poor results, i.e., to visualize details in samples with little density variations, such as soft tissue specimens.In these samples, phase-contrast imaging can yield superior results because of its much higher sensitivity to small density differences, 1 while darkfield imaging gives information on a sub-pixel scale by revealing the scattering strength of structures in the sample, which cannot be resolved directly by the detector, such as fibers, cracks, and nanopores. 2][10][11] The latter two allow the simultaneous reconstruction of multimodal images (absorption, phase and dark-field images) from a single data set. 12,13Propagation-and grating-based methods have successfully been implemented at laboratory sources because of their tolerance to divergent and polychromatic beams. 14,15ecently, a new approach for multimodal x-ray imaging, namely "x-ray speckle tracking", has been proposed. 16,17ingle-shot x-ray speckle tracking only requires a simple setup and is very efficient, as all three image modalities can be obtained from a single data set.The method relies on generating a near-field speckle pattern created by interference of x-rays scattered from a diffuser containing random structures, such as a piece of sandpaper or a biological filter membrane. 18hen a sample is inserted into the beam, the speckles are displaced and distorted.The change in speckle position and shape is analyzed by a digital image correlation algorithm to reconstruct transmission, phase, and visibility-contrast images.In single-shot speckle tracking, one image with the diffuser only and one image with diffuser and sample in the beam are taken and the image correlation algorithm is applied. 16In the speckle-scanning technique, the diffuser is scanned in small sub-pixel steps in the horizontal and vertical direction and the analysis is performed pixelwise. 17,19This method has the advantage of a higher spatial resolution, however highprecision scanning stages are needed and a large number of images are required, which makes it slower compared to the single-shot technique.
The first demonstrations of x-ray speckle-based imaging have been implemented at synchrotron sources using a monochromatic beam. 16,20More recently, implementations of x-ray speckle imaging with a polychromatic laboratory source have been reported. 19,21A liquid-metal-jet source of very high brightness 22 and a piece of sandpaper as a random diffuser were used in these experimental setups.Despite the broad bandwidth of this source, quantitatively correct values for phase and transmission were reliably retrieved in Ref. 21.While experimental and theoretical studies have been performed on the beam hardening effects due to the use of polychromatic beams in the context of other x-ray phasecontrast imaging methods, [23][24][25][26] the effect of polychromaticity on speckle-based images has not yet been investigated.
Here, we present a simulation study on the impacts of using a polychromatic x-ray spectrum for speckle-based multimodal x-ray imaging.In particular, we show how the energy bandwidth affects the visibility of the near-field speckles, and we discuss the effects of beam hardening on the different image modalities accessed with this method.
][29] The simulated setup shown in Fig. 1 consists of an x-ray source, a diffuser, a sample, and a detector.A parallel beam, as coming from a distant source, and a pixel size of 4 lm are used in the simulations.The propagation of the wavefront between the different components is modeled using the diffraction integral in the near-field Fresnel approximation.In the paraxial approximation, the propagation between a starting plane ðx 0 ; y 0 ; z 0 Þ and a plane ðx; y; zÞ downstream is described as follows: 30 where Wðx; y; zÞ denotes the wavefront in the plane ðx; y; zÞ and Wðx 0 ; y 0 ; z 0 Þ the wavefront in the starting plane ðx 0 ; y 0 ; z 0 Þ, with z as propagation direction.In the above equation, k ¼ 2p=k is the wavenumber and k is the wavelength of the x-rays.The wavefront after passing through the diffuser is determined by calculating the complex transmission function of the diffuser in the projection approximation 31 and multiplying it with the incoming wavefront.The same procedure is performed for the sample positioned at a distance d diff-sam ¼ 30 cm from the diffuser and the resulting wavefront is recorded in the detector plane located d diff-det ¼ 163 cm downstream of the diffuser.
As diffuser we simulate a piece of sandpaper with SiC grains on a cellulose layer. 32It is modeled as a 3D volume of total thickness 300 lm consisting of a layer containing randomly distributed SiC spheres of 14.4-28.8lm diameter and a 243 lm thick cellulose support.
The sample is a cuboid with a quadratic base of size 500 Â 500 pixels in the x-z plane and a height of 400 pixels in y direction, rotated by 45 around the y-axis so that an edge is directly facing the beam (see Fig. 1).Cuboids of different materials-polymethylmethacrylate (PMMA) and aluminum-are simulated and the results are compared.The simple geometry and composition of the object were chosen to ensure that the effects of the polychromatic illuminating x-ray beam are separated from the influence of the sample properties.
A detector point spread function of two pixels FWHM (full width at half maximum) is assumed and a Gaussian smoother with a standard deviation of r smooth ¼ ð2 Â pixel sizeÞ=2:355 is applied to all simulation results.
To observe the influence of the degree of polychromaticity of the spectrum on the speckle pattern, different x-ray energy spectra centered at E 0 ¼ 20 keV with varying FWHM are used and compared to the monochromatic case at 20 keV.The shape of the spectra was modeled by convolving a box function of certain width, varying from 2 to 38 keV, with a Gaussian of form (2) with r ¼ 2 keV.For a small width of the box function, the energy spectra created this way are almost Gaussian-shaped with increasing FWHM.For larger widths of the box function, we obtain nearly box-shaped spectra with smoothed edges.In addition, we considered the extreme case of a non-smoothed box spectrum of width 40 keV.Some of these are unrealistic spectra for laboratory setups, but give a good indication for the effects in cases of a very broad x-ray spectrum.
As a measure of the bandwidth of the Gaussiansmoothed box spectra, we use their FWHMs, which are listed in Table I.
The Fresnel width at the mean energy E 0 is ffiffiffiffi ffi kz p ¼ 10:1 lm, indicating that features at this scale and smaller are strongly affected by diffraction effects.Equivalently, we obtain a Fresnel number (as defined by Burvall et al. 33 ) of 0.63, which agrees with the Fresnel number of 0.11-2.02for the near-field speckle measurements reported by Cerbino et al. 18

III. PROPERTIES OF X-RAY NEAR-FIELD SPECKLE PATTERNS
Examples of near-field speckle patterns without and with sample obtained as described above are shown in Figs.Two parameters are used to describe the properties of the near-field speckle pattern: the speckle size and the speckle visibility (speckle contrast).
The most common way to determine the dimensions of the speckles is by using the 2D autocorrelation function of the intensity interference pattern.5][36] Here, the speckle size is calculated as the distance at which the autocorrelation function of the pattern shows the first minimum in horizontal direction.Using this method, we get an estimated speckle size of four pixels, corresponding to 16 lm, for the speckle pattern in Fig. 2(a), which is close to the smallest features in the diffuser.
We define the visibility as the standard deviation normalized by the mean intensity value of the pattern where r and I are the standard deviation and mean value, respectively, of the intensity I(x, y), evaluated over an area larger than the speckle size.The speckle visibility is calculated locally in small windows of size 24 Â 24 pixels, which are moved across the entire image in steps of one pixel.The median value of the windows was taken as a measure for the speckle visibility. 37The visibility of the pattern in Fig. 2(a) is 40%.
Since the extraction of the image signals is based on the analysis of the speckle shape and position, both speckle size and contrast are expected to affect the differential phase and transmission data retrieved with this method.The size of the speckles can be controlled by the choice of the diffuser properties as shown in Ref. 18. Well-resolvable but small speckles are desired to maintain a high resolution in the final data.Moreover, as for other multimodal imaging techniques that rely on the use of a reference interference pattern to access the image signals, such as x-ray grating interferometry, a high visibility value is expected to provide a higher signal-to-noise ratio in the retrieved images, see, e.g., Refs.38 and 39.
One of the factors that are expected to affect the speckle contrast is the width of the illuminating x-ray spectrum.To test this hypothesis and evaluate this effect, the visibility of the speckle pattern is calculated for the spectra described in Sec.II.
Figure 3 clearly shows a decrease in speckle visibility with increasing bandwidth of the energy spectrum.This can be attributed to the change in shape of the speckles with energy (see Figs. 7(b)-7(e)).The superposition of the interference patterns from the different energy contributions of the polychromatic spectrum results in a blurring of the speckle pattern, hence decreasing its visibility.However, the drop in visibility from 43% for the monochromatic case to 29% observed for the extreme case of the box spectrum with width 40 keV is only moderate and should not have a crucial impact on the reliability of the tracking algorithm.
Figure 3 shows the spectra before reaching the diffuser.Some hardening of the spectrum is expected due to the presence of the diffuser, which can be neglected for our further simulations. 40he next sections are organized as follows.We first (Sec.V) describe the signal extraction method, and discuss the transmission, refraction angle, and visibility-contrast images obtained with a monochromatic beam.In Sec.VI, we discuss the effects of beam hardening on the three signals separately.

V. MULTIMODAL IMAGE RETRIEVAL
The extraction of the image signals and beam hardening artifacts on the retrieved data have been studied using simulations with a homogeneous cuboid.The cuboid image superimposed on the speckle pattern is shown in Fig. 2(b), and the speckle displacement caused by the sample is highlighted in the insets in Figs.2(c) and 2(d).Differential phase, transmission, and visibility contrast images of this sample obtained with polychromatic beams have been evaluated against images of the same object accessed with 20 keV monochromatic x-rays (Fig. 4).
The reconstruction algorithm used to retrieve the final data is based on image correlation and is described in detail in Ref. 21.A window of 24 Â 24 pixels is moved across the entire matrix of reference (diffuser only) and sample (sample and diffuser) images in steps of one pixel extracting the minute displacement and the decrease in intensity of the speckle pattern within the window.From the displacement, one can determine the refraction angle and, after integration of the orthogonal differential phase data, the phase shift induced by the sample.

A. Refraction angle
The refraction of x-rays, and thus the phase shift induced by the sample, introduces a displacement of the speckle pattern in the image plane.The measurement of this displacement D x;y in x/y direction allows the retrieval of the refraction angles a x;y : where i and j indicate the pixel index in the retrieved image which corresponds to the position of the central pixel of the masking window in the raw data.For every point (x, y) of the observation plane, the refraction angle is proportional to the first derivative of the phase shift Uðx; yÞ caused by the sample with respect to the reference beam Moreover, Uðx; yÞ can be expressed in terms of the thickness t(x, y) of the sample where d indicates the refractive index decrement.We are using a cuboid rotated by 45 around the y-axis (see Fig. 1).In this case, the thickness of the sample is given by tðx; yÞ ¼ 62x þ ' for the left and right half of the rotated cuboids, respectively, with ' corresponding to the diagonal length of the base of the cuboid.Therefore, we expect a constant refraction angle in horizontal direction for each half of the cuboid depending only on the refractive index of the sample 41 In y-direction, the thickness of the sample does not change and the refraction angle is zero.The predicted behavior is confirmed in our simulation results in Figs.4(a) and 4(b), showing the refraction along the two directions for the case of aluminum.

B. Transmission
A transmission image is retrieved by minimizing the same cost function used for the refraction angle calculation. 21The algorithm evaluates the change in average intensity of the pattern within the masking windows aligned for the displacement caused by refraction.In case of minute displacements smaller than one pixel as those usually observed in speckle-based imaging, the transmission T in each pixel can be approximated as where I sam ½i; j is the mean intensity of the sample-and-diffuser speckle pattern within the mask centered in pixel ½i; j of the raw data and I diff ½i; j the mean intensity of the diffuser-only speckle pattern calculated at the same position.
For every point (x, y) of the observation plane, the transmission T is described by the Lambert-Beer law Tðx; yÞ ¼ e Àltðx;yÞ ¼ e Àlð62xþ'Þ ; ( where l is the linear attenuation coefficient.The reconstructed transmission image for an aluminum cuboid is shown in Fig. 4(c).At the borders of the sample edge enhancement leads to transmission values exceeding 1, which do not represent the absorption properties of the cuboid in this area.

C. Visibility contrast
The comparison of diffuser and sample-and-diffuser data also enables us to determine a visibility-contrast image, which quantifies the change in speckle visibility when a sample is introduced in the beam path.In previous publications on speckle-based imaging, and in analogy to x-ray grating interferometry, this signal has been called dark-field signal as it can be caused also by small-angle x-ray scattering or multiple refraction within the sample. 17,21Here, we prefer to use the more general term "visibility contrast" that implicitly includes different contributions other than scattering to the signal formation.
We define our visibility-contrast signal V½i; j as the ratio of the visibility v sam ½i; j of the sample-and-diffuser intensity pattern and the visibility v diff ½i; j of the diffuser-only pattern where r sam ½i; j and r diff ½i; j denote the standard deviations of the speckle patterns and T is the transmission through the sample.A homogeneous object not containing tiny scattering features that is illuminated by a monochromatic beam does not alter the speckle visibility and thus the visibility-contrast signal obtained this way for the aluminum cuboid is approximately 1 over the entire sample, see Fig. 4(d).The slight deviation from unity observed in the image is due to the displacement of the speckles by refraction in the sample-anddiffuser image.This shift was not taken into account for the calculation of the visibility-contrast signal as defined in Eq. ( 10) and we therefore expect a small deviation of the signal from 1, especially in areas of strong refraction, such as the edges of the sample.

D. Residual error and phase retrieval
The speckle-tracking algorithm detects the lateral displacement and allows to calculate the change in intensity and visibility of the speckle pattern.However, there may also be other modifications to the pattern, such as (i) the distortion of speckles (e.g., speckles might be not only displaced, but their shape might become more elongated as a consequence of refraction or scattering) or (ii) the superposition with a second speckle pattern created by the sample itself when it contains features on the same length scale as the scatterers of the diffuser.These effects can be taken into account by another signal, which we call "residual error" q½i; j.The residual error is the value of the objective function in the reconstruction algorithm at the optimum with respect to the fitting coefficients.It corresponds to the total remaining difference between the two images that cannot be interpreted as speckle displacement or transmission.
It can be shown that the uncertainty on the speckle displacement and hence on the refraction angle scales roughly like T= ffiffiffi q p .Hence, this quantity can be incorporated to define weights in a regularized phase integration algorithm, which can greatly improve the quality of the reconstructed phase image as recently demonstrated in Ref. 21.
The residual error image and the phase image retrieved as described in Ref. 21 are shown in Figs.5(a) and 5(b), respectively.The residual error is especially high at the edges of the object where the speckle shape is severely affected by the presence of high-frequency features.The phase signal in Fig. 5(b) shows a maximum phase shift of À360 rad in the center of the cuboid.The retrieved phase U matches well with the value calculated using Eq. ( 6).For example, for a thickness t of approximately 2.8 mm at the center of the cuboid, a wavelength of k ¼ 6:2 Â 10 À11 m corresponding to an energy of 20 keV and d Al;20 keV ¼ 1:36 Â10 À6 (see Ref. 42), the retrieved phase is expected to be U Al;20 keV ¼ À390 rad.

VI. BEAM HARDENING ARTIFACTS IN THE RETRIEVED IMAGES
Using a polychromatic beam has impacts on the transmission, refraction, and visibility signals due to hardening of the spectrum by the sample.Among others, Chabior et al. 23 and Munro and Olivo 24 analyzed this effect for gratingbased techniques.They showed that for both absorption and refraction angle signal, the images retrieved with a polychromatic beam can be described by an effective energy that is dependent on the sample properties.Here, we characterize these effects for speckle-tracking imaging and we illustrate that beam hardening also affects the visibility-contrast data.
Beam hardening for speckle-based imaging has been studied using the spectrum of FWHM ¼ 9.8 keV illuminating aluminum and PMMA cuboids.The profile plots of the simulated images, obtained by averaging the signal along y, are shown in Fig. 6.The results are plotted against the profiles expected from a setup with monochromatic x-rays of an energy of 20 keV, which are used as reference.These theoretical profiles (dashed lines) are calculated using Eq. ( 9) for the transmission signal, Eq. ( 7) for the refraction angle signal, and Eq. ( 6) for the phase signal.
The values obtained from the simulations with a polychromatic spectrum are compared with the effective quantities retrieved from analytical calculation.The results from speckle-tracking are averaged along y at the horizontal position indicated by the orange line in Fig. 6(a) and the error is quantified as the corresponding standard deviation.

A. Beam hardening in the transmission signal
In the transmission line profiles of Fig. 6(a), a deviation from the monochromatic case at 20 keV can be seen for aluminum, and it can almost be neglected for PMMA.This is because the absorption coefficient lðEÞ is dependent on the x-ray energy E (lðEÞ depends on 1=E 3 when the attenuation is dominated by the photoelectric effect), and the transmitted polychromatic spectrum depends on the thickness of the sample.As the beam hardens with increasing thickness of the sample, the effective attenuation coefficient l e changes and the transmission curve deviates from the behavior for the monochromatic case as illustrated in Fig. 6(a).The hardening of the spectrum in the sample is strongly reduced for PMMA as the attenuation coefficient is much lower than for aluminum, leading to a high transmission of x-rays.
Ignoring the detector response, the effective linear attenuation coefficient l e for the polychromatic case can be written as, see, e.g., Ref.
where S(E) describes the transmitted spectrum.The transmitted intensity fraction can be calculated by substituting this l e in the Lambert-Beer's law in Eq. ( 9).For example, when inserting in Eq. ( 11) the transmitted spectrum through 1.4 mm aluminum (see position indicated as the orange vertical line in Fig. 6(a)), one gets l e;Al ¼ 7:6 cm À1 , which yields a transmission value of 34% for aluminum.For PMMA, an effective attenuation coefficient of l e;PMMA ¼ 0:7 cm À1 is obtained, giving a transmission of 90%.From the speckle-tracking simulation in Fig. 6(a), we retrieve transmitted intensity fractions of T Al ¼ ð29:160:2Þ % and T PMMA ¼ ð91:160:4Þ % at the same position.The deviation is due to the fact that inserting the effective l-value into Lambert-Beer's law is an approximation only valid for weakly absorbing objects.Accurate effective transmission values can be obtained by performing the integration over the exponential term where t is the object thickness and S 0 ðEÞ the spectrum impinging on the sample after passing through the diffuser.Equation (12) gives transmission values of T e; Al ¼ 29 % and T e; PMMA ¼ 90 %, which compare well with the values from speckle tracking.
B. Beam hardening in the refraction angle and phase signals Figure 6(b) shows the refraction angle along x for different simulation conditions.The decrease in refraction angle with increasing thickness of the sample towards its center can clearly be seen for aluminum.This decrease is caused by the fact that low energies in the spectrum are absorbed more strongly than high energies, leading to hardening of the spectrum.Moreover, since dðEÞ is proportional to E À2 , the refraction angle aðEÞ also depends on E À2 for a given geometry.For PMMA, the refraction angle remains nearly constant because the much lower absorption of this material does not have a strong effect on the spectrum.
As for the transmission signal, by neglecting the detector response and the change in visibility of the speckle pattern over the energy spectrum, the effective refractive index d e can be written as, see, e.g., Ref. 23, Using the above formula, we obtain an effective refractive index decrement, at the same position of the aluminum cuboid as in Sec.VI A, of d e;Al ¼ À1:18 Â 10 À6 , which agrees well with the value d Al ¼ Àð1:1360:08Þ Â 10 À6 retrieved from speckle tracking by using Eq. ( 7) (see Fig. 6(b)).Also, the calculated effective decrement d e;PMMA ¼ À0:70 Â 10 À6 for PMMA at this position compares well with the result d PMMA ¼ Àð0:6260:05Þ Â 10 À6 from the reconstructed simulation data.
The effects of beam hardening on the refraction angle data are transferred to the integrated phase images, see Fig. 6(c).The simulated results for both materials agree with the theoretically calculated curve for a monochromatic beam at the borders of the cubes.With increasing thickness of the sample, the effect of beam hardening leads to a deviation from the monochromatic case.

C. Beam hardening in the visibility-contrast signal
In previous publications on beam hardening effects in grating-based imaging, there was no discussion on the effects of using a polychromatic beam on the dark-field images provided by these methods.However, for speckle-based imaging, we observe that also the visibility contrast is affected by the polychromatic nature of the beam, similarly to the transmission and refraction signals.While for the monochromatic case, the visibility-contrast signal is expected to be 1 for a homogeneous object (see Sec. V C), Fig. 6(d) illustrates that the visibility contrast deviates from unity in the area of the sample when a polychromatic beam is used.In the following, we describe this phenomenon in more detail.
For the monochromatic case, we evaluated the speckle visibility from the spatially-dependent intensity pattern I(x, y) as described in Eq. ( 3), where r and I are the standard deviation and mean value, respectively, of I(x, y), evaluated over an area larger than the speckle size: The visibility of a speckle pattern produced by a polychromatic source is also defined numerically using Eq. ( 3).The measured intensity pattern I poly ðx; yÞ is a superposition of all energy contributions in the spectrum where the quantity I E ðx; yÞ has units of intensity per unit energy.The detected spectrum is then SðEÞ ¼ I E .The variance of the total intensity field can be written as The integrand in Eq. ( 17) is a cross-correlation between speckles at two different energies.In the ideal case, the fluctuations in the speckle patterns change in amplitude, but keep the same spatial profile.The term in the integrand then reduces to r E r E 0 , so that Eq. ( 17) reduces to r poly ¼ Ð r E dE, where r E has unit of intensity per unit energy like I E .Within this assumption, and using the fact that r E ¼ vðEÞ I E , the effective visibility v e in the polychromatic case is simply given by In practice, the change of the speckle pattern as a function of energy reduces the value of r poly , so that Eq. ( 18) can be seen as an upper bound on the true visibility.
To verify our formalism, we performed further simulations and we calculated the visibility of the near-field speckle pattern obtained for the same propagation distance of 163 cm by illuminating the diffuser with a monochromatic beam with different energies between 8 and 100 keV.The curve in Fig. 7(a) shows that the visibility strongly depends on the energy and in general decreases with increasing energy of the x-ray beam.We observe a peak at around 17 keV which can be related to the maximum of the contrast-transfer function 43 described, e.g., in Refs.44-46 and applied to nearfield speckles in Ref. 18.Moreover, it can be seen in the regions of interest (50 Â 20 pixels) shown in Figs.7(b)-7(e) that the shape of the speckles changes with the x-ray energy, which is also an effect of the contrast-transfer function. 46quation ( 18) allows to determine the effective visibility v e of the speckle pattern obtained with the polychromatic beam under the assumption of a constant speckle shape, using the visibility values obtained from the simulations with a monochromatic beam (see Fig. 7).Without the sample in the beam path, this gives a value of v e;air ¼ 41:7 %.With the aluminum cube in the beam, the visibility is reduced and reaches a value of v e;Al ¼ 39:9 % at the horizontal position indicated by the orange line in Fig. 6(a).For the PMMA cube, the visibility is only slightly affected and has a value of v e;PMMA ¼ 41:6 % at the same position.
Using Eq. ( 10), we can calculate the visibility-contrast signal at the given horizontal position of the cube.A value of V e;Al ¼ 0:955 is determined for aluminum and V e;PMMA ¼ 0:998 for PMMA, which agrees well with the results V Al ¼ ð0:94960:035Þ and V PMMA ¼ ð0:99960:024Þ obtained from speckle tracking shown in Fig. 6(d).

VII. CONCLUSIONS
Following the first demonstration of x-ray speckle multimodal imaging with a laboratory source, we have presented a study to describe speckle-based image formation and the properties of the retrieved images when the sample is illuminated by a polychromatic x-ray beam.
The visibility of the speckle pattern-a crucial parameter for the image quality of speckle-based images-decreases with increasing width of the x-ray spectrum.However, under otherwise optimal conditions, as assumed in our simulations, the speckle visibility does not drop to values critical for a successful image reconstruction, even for broad energy spectra.Our results suggest that coherent speckle-based methods have the potential to be implemented not only at synchrotron facilities but also at a wide range of laboratory setups and can thus be extended for widespread use.
The analysis of the beam hardening effects in the multimodal images and the description of the formation of the visibility-contrast signal are fundamental results for the future development and improvement of speckle-tracking methods with polychromatic beams.
Effects, such as noise, source size, and detector response, are not considered in this study.Follow-up investigations will be performed including these factors in our simulations to accurately model experimental setups and to investigate the effects of different mean x-ray energies, diffuser types, and propagation distances.
In this paper, the effective transmission and refraction properties of a sample illuminated by a polychromatic beam were evaluated using a general formalism considering the detected spectrum S(E).However, the detected spectrum is dependent on the geometry and the properties of the sample and might hence be hard to retrieve.Nevertheless, it is possible for particular cases to make approximations and develop a more specific model from the general formulas, which can be used to correct for the beam hardening effects in the retrieved signals as reported, e.g., in Ref. 23.
The results obtained here can also be applied to other speckle-based imaging techniques, such as speckle scanning. 17 FIG. 1. Simulated setup using a plane-wave source, a piece of sandpaper as diffuser and a rotated cuboid as sample.The simulated diffuser-sample distance is d diff-sam ¼ 30 cm, the diffuser-detector distance d diff-det ¼ 163 cm.

FIG. 2 .
FIG. 2. Simulated near-field speckle pattern in the detector plane (a) without sample and (b) with an aluminum cuboid rotated by 45 as sample.The regions of interest marked in white are shown in enlarged views in (c) and (d) for the reference image without sample and the intensity image with sample, respectively.Corresponding speckles in (c) and (d) are marked, and the displacement of the pattern and its decrease in intensity are visible.The gray values are arbitrary intensity units.A spectrum with FWHM ¼ 9.8 keV was used in the simulations.

FIG. 3 .
FIG.3.Visibility of the speckle pattern versus the FWHM of the spectrum.The visibility decreases with increasing polychromaticity of the energy spectrum.For the data points in the boxes, the corresponding spectra are shown in one of the inset windows.The first data point (green) corresponds to a monochromatic beam with an energy of 20 keV.The last data point (red) represents the case of a box spectrum of width 40 keV without smoothing.The spectra shown here are before the beam reaches the diffuser.A moderate decrease in visibility with increasing FWHM of the spectrum can be observed.

FIG. 5 .FIG. 6 .
FIG. 5. (a) Image showing the residual error in the aluminum cuboid data normalized by the transmission squared (in arbitrary units).(b) Integrated phase of the aluminum cuboid illuminated by a monochromatic beam retrieved using the regularized phase integration method. l ,

FIG. 7 .
FIG. 7. (a) Visibility of the simulated speckle pattern versus energy of the xrays.The simulations were performed using monochromatic beams in the energy interval 8-100 keV in steps of 1 keV.Panels (b)-(e) show a ROI of size 50 Â 20 pixels of the speckle patterns obtained with a monochromatic beam of the energies 8 keV, 17 keV, 25 keV, and 50 keV (see red circles in (a)).

TABLE I .
FWHMs of the Gaussian-smoothed box spectra for different box widths.