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 dark-field 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}

Several methods using these advanced imaging modalities have been developed, including propagation-based,^{3–5} analyzer-based,^{6,7} and grating-based methods.^{8–11} The latter two allow the simultaneous reconstruction of multimodal images (absorption, phase and dark-field images) from a single data set.^{12,13} Propagation- and grating-based methods have successfully been implemented at laboratory sources because of their tolerance to divergent and polychromatic beams.^{14,15}

Recently, a new approach for multimodal x-ray imaging, namely “x-ray speckle tracking”, has been proposed.^{16,17} Single-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.^{18} When 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.^{16} In 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,19} This method has the advantage of a higher spatial resolution, however high-precision 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,20} More recently, implementations of x-ray speckle imaging with a polychromatic laboratory source have been reported.^{19,21} A 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 phase-contrast imaging methods,^{23–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.

## II. SIMULATION SETUP AND PARAMETERS

The simulations performed for this study are based on a wave-optical simulation framework developed in Python with extensions in C++.^{27–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 *μ*m 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 $(x0,y0;z0)$ and a plane $(x,y;z)$ downstream is described as follows:^{30}

where $\Psi (x,y;z)$ denotes the wavefront in the plane $(x,y;z)$ and $\Psi (x0,y0;z0)$ the wavefront in the starting plane $(x0,y0;z0)$, with *z* as propagation direction. In the above equation, $k=2\pi /\lambda $ is the wavenumber and *λ* 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.^{32} It is modeled as a 3D volume of total thickness 300 *μ*m consisting of a layer containing randomly distributed SiC spheres of 14.4–28.8 *μ*m diameter and a 243 *μ*m 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 $\sigma smooth=(2\xd7pixel\u2009size)/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

with $\sigma =$ 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 Gaussian-smoothed box spectra, we use their FWHMs, which are listed in Table I.

Box width [keV] | 2 | 6 | 10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 |

FWHM [keV] | 4.5 | 6.0 | 9.8 | 13.5 | 17.3 | 21.1 | 24.8 | 28.6 | 32.4 | 36.1 |

Box width [keV] | 2 | 6 | 10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 |

FWHM [keV] | 4.5 | 6.0 | 9.8 | 13.5 | 17.3 | 21.1 | 24.8 | 28.6 | 32.4 | 36.1 |

The Fresnel width at the mean energy *E*_{0} is $\lambda z=10.1\u2009\mu m$, 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.02 for 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. 2(a) and 2(b), respectively. The inset windows (c) and (d) reveal an enlarged view of the speckles showing their displacement caused by the sample. A spectrum with a FWHM of 9.8 keV was used, which can be representative of a filtered laboratory source setup.

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. Several ways to retrieve the speckle size from the autocorrelation function have been proposed.^{34–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 *μ*m, 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 *σ* and $I\xaf$ 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.^{37} The 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.

## IV. EFFECT OF THE X-RAY ENERGY SPECTRUM BANDWIDTH ON SPECKLE VISIBILITY

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.^{40}

The 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 $\Delta x,y$ in *x*/*y* direction allows the retrieval of the refraction angles $\alpha 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 $\Phi (x,y)$ caused by the sample with respect to the reference beam

Moreover, $\Phi (x,y)$ can be expressed in terms of the thickness *t*(*x*, *y*) of the sample

where *δ* 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)=\xb12x+\u2113$ for the left and right half of the rotated cuboids, respectively, with $\u2113$ 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}

### B. Transmission

A transmission image is retrieved by minimizing the same cost function used for the refraction angle calculation.^{21} The 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\xafsam[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\xafdiff[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

where *μ* 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,21} Here, 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 $vsam[i,j]$ of the sample-and-diffuser intensity pattern and the visibility $vdiff[i,j]$ of the diffuser-only pattern

where $\sigma sam[i,j]$ and $\sigma 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-and-diffuser 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” $\rho [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/\rho $. 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 $\Phi $ 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 $\lambda =6.2\xd710\u221211$ m corresponding to an energy of 20 keV and $\delta Al,20\u2009keV=1.36\xd710\u22126$ (see Ref. 42), the retrieved phase is expected to be $\Phi Al,20\u2009keV=\u2212390$ 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 grating-based 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 $\mu (E)$ is dependent on the x-ray energy *E* ($\mu (E)$ depends on $1/E3$ 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 $\mu 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 $\mu e$ for the polychromatic case can be written as, see, e.g., Ref. 23,

where *S*(*E*) describes the transmitted spectrum. The transmitted intensity fraction can be calculated by substituting this $\mu 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 $\mu e,Al=7.6\u2009cm\u22121$, which yields a transmission value of 34% for aluminum. For PMMA, an effective attenuation coefficient of $\mu e,PMMA=0.7\u2009cm\u22121$ is obtained, giving a transmission of 90%. From the speckle-tracking simulation in Fig. 6(a), we retrieve transmitted intensity fractions of $TAl=(29.1\xb10.2)\u2009%$ and $TPMMA=(91.1\xb10.4)\u2009%$ at the same position. The deviation is due to the fact that inserting the effective *μ*-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 $S0(E)$ the spectrum impinging on the sample after passing through the diffuser. Equation (12) gives transmission values of $Te,\u2009Al=29\u2009%$ and $Te,\u2009PMMA=90\u2009%$, 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 $\delta (E)$ is proportional to $E\u22122$, the refraction angle $\alpha (E)$ also depends on $E\u22122$ 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 $\delta 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 $\delta e,Al=\u22121.18\xd710\u22126$, which agrees well with the value $\delta Al=\u2212(1.13\xb10.08)\xd710\u22126$ retrieved from speckle tracking by using Eq. (7) (see Fig. 6(b)). Also, the calculated effective decrement $\delta e,PMMA=\u22120.70\xd710\u22126$ for PMMA at this position compares well with the result $\delta PMMA=\u2212(0.62\xb10.05)\xd710\u22126$ 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 *σ* and $I\xaf$ 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 $Ipoly(x,y)$ is a superposition of all energy contributions in the spectrum

where the quantity $IE(x,y)$ has units of intensity per unit energy. The detected spectrum is then $S(E)=I\xafE$.

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 $\sigma E\sigma E\u2032$, so that Eq. (17) reduces to $\sigma poly=\u222b\sigma E\u2009dE$, where $\sigma E$ has unit of intensity per unit energy like $IE$. Within this assumption, and using the fact that $\sigma E=v(E)I\xafE$, the effective visibility $ve$ 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 $\sigma 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 near-field 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.^{46}

Equation (18) allows to determine the effective visibility $ve$ 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 $ve,air=41.7\u2009%$. With the aluminum cube in the beam, the visibility is reduced and reaches a value of $ve,Al=39.9\u2009%$ 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 $ve,PMMA=41.6\u2009%$ 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 $Ve,Al=0.955$ is determined for aluminum and $Ve,PMMA=0.998$ for PMMA, which agrees well with the results $VAl=(0.949\xb10.035)$ and $VPMMA=(0.999\xb10.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,19}

## ACKNOWLEDGMENTS

We acknowledge financial support from the DFG Cluster of Excellence Munich-Centre for Advanced Photonics (MAP), the DFG Gottfried Wilhelm Leibniz program and the European Research Council (ERC, FP7, StG 240142, and 279753). We acknowledge Tunhe Zhou and Anna Burvall from KTH, Stockholm for fruitful discussions.

## References

_{n}with a density of 1.5 g/cm

^{3}.

The contrast-transfer function is a result of free-space propagation. The intensity in the detector plane can be determined in Fourier space as the product of the free-space propagator and the complex object transmission function of the sample [44–46]. The part related to the phase of the wavefront is called phase contrast-transfer function and is given by $sin(\pi \lambda zq2)$, where *λ* is the wavelength of the x-rays, *z* the propagation distance, and *q* denotes the spatial frequency. The first maximum appears for $\pi \lambda zq2=\pi /2$ and hence at the spatial frequency $qmax=1/2\lambda z$ for a given energy. In Fig. 7, we observe maximum visibility at an energy of approximately $E=17\u2009keV$ corresponding to a wavelength of $\lambda =7.3\xd710\u221211\u2009m$. With a propagation distance of $z=1.63\u2009m$, we obtain a spatial frequency of $qmax=0.0648\u2009\mu m\u22121$. The period $p=1/qmax=15.4\u2009\mu m$ is consistent with the dimensions of the scattering features of the diffuser, which contains grains of 14.4–28.8 *μ*m diameter.