teaching and education\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

Journal logoJOURNAL OF
APPLIED
CRYSTALLOGRAPHY
ISSN: 1600-5767

Illustrated Fourier transforms for crystallography

CROSSMARK_Color_square_no_text.svg

aLaboratoire de Cristallographie et Modélisation des Matériaux Minéraux et Biologiques, UMR UHP–CNRS 7036, Faculté des Sciences et Techniques, Nancy-Université, Boulevard des Aiguillettes, BP 239, 54506 Vandoeuvre-lès-Nancy, France
*Correspondence e-mail: emmanuel.aubert@lcm3b.uhp-nancy.fr

(Received 26 March 2007; accepted 5 September 2007)

Concepts such as Fourier transformation, convolution and resolution that are required to understand crystallography are illustrated through visual examples. These concepts can be explained pedagogically in a very direct way using the DigitalMicrograph software from Gatan Inc. (https://www.gatan.com/imaging/downloads.php ), originally intended for electron microscopy data collection and analysis, and practical exercises developed around this tool can be used in teaching crystallography.

1. Introduction

Teaching crystallography implies the development of concepts such as Fourier transformation, convolution, resolution etc. that are not necessarily obvious for beginners. In order to help students new to this field, some interactive web sites have been created (e.g. Schoeni & Chapuis, 2006[Schoeni, N. & Chapuis, G. (2006). https://lcr.epfl.ch/page37304.html ]) and practical exercises using the Mathematica software were recently developed by Dumas et al. (2006[Dumas, P., Vanwinsberghe, J. & Cura, V. (2006). Crystallographic Teaching Commission of the IUCr Newsletter, No. 1, pp. 4-10.]). Practicals were also developed in Nancy University for the `Signal Processing' lectures intended for second-year university students (Licence Science de la Vie L2) and for the National CNRS Thematic School `Structural Analysis by X-ray Diffraction, Crystallography under Perturbation', held in Nancy in September 2006 (https://www.lcm3b.uhp-nancy.fr/nancy2006/ ).

In single-crystal X-ray diffraction and under kinematic conditions, the amplitude of the X-ray beam diffracted by a crystal of electron density [\rho ({\bf r})] is given by

[E({\bf H}) = E_{\rm e} \,F({\bf H})\,\Gamma ({\bf H}), \eqno (1)]

where Ee is the amplitude scattered by one electron, [\Gamma ({\bf H})] is the interference function giving rise to the sharp Bragg diffraction peaks, and

[F({\bf H}) = \int\limits_{\rm cell} {\rho ({\bf r}) \exp({2\pi i{\bf H} \cdot {\bf r}}) \,{\rm d}{\bf r}} \eqno (2)]

is the structure factor associated with the reciprocal-lattice vector [\bf H]. Since it is the Fourier transform of the thermally smeared electron density, the structure factor contains information about the unit-cell content (the motif composition). The diffracted intensities for a crystal composed of a large number of unit cells are then determined by

[I({\bf H}) \propto \left| {F({\bf H})} \right|^2 = F({\bf H})\, F^* ({\bf H}). \eqno (3)]

The structure factors are the Fourier coefficients of the electron density [\rho ({\bf r})] of the motif inside the unit cell:

[\rho ({\bf r}) = {1 \over {V_{\rm cell} }}\sum\limits_{\bf H} {F({\bf H}) \, \exp({ - 2\pi i{\bf H}\cdot {\bf r}})}. \eqno (4)]

Structure factors are generally complex quantities and can be represented in polar form:

[F({\bf H}) = \left| {F({\bf H})} \right| \exp[{i \varphi ({\bf H})}], \eqno (5)]

with the modulus [\left| {F({\bf H})} \right|] and the phase [\varphi ({\bf H})].

However, according to (3)[link], the diffraction process leads to the determination of only the moduli [\left| {F({\bf H})} \right|], the information about the phase being lost. Specialized experimental techniques such as multi-beam X-ray diffraction or convergent-beam electron diffraction offer possibilities to measure relative phases between some structure factors (see for example Spence & Zuo, 1992[Spence, J. C. H. & Zuo, J. M. (1992). Electron Microdiffraction. New York: Plenum.]).

Moreover, it is not possible to measure all Fourier coefficients of the electron density, firstly because of spatial limitations around the diffractometer (the diffraction angle has maximum practical value 2θmax < 180°, depending on the experimental setup), and secondly because one uses nonzero wavelength λ (from the Bragg law the reciprocal resolution is [{{\left| {\bf H} \right|} / 2} = {{\sin \theta } / \lambda}], and since λ is finite the resolution cannot be infinite).

This paper aims to present examples that can be used to illustrate graphically Fourier transform properties in crystallography courses, introducing notions such as resolution, convolution and signal-to-noise ratio using the free (time-limited licence) demo version of a very simple but nevertheless powerful software (DigitalMicrograph from Gatan; https://www.gatan.com/imaging/downloads.php ), originally intended for electron microscopy data collection and analysis.

We draw an analogy between a single-crystal X-ray experiment and manipulation of digital images, as shown in Fig. 1[link].

[Figure 1]
Figure 1
Analogy between single-crystal X-ray diffraction and image manipulation. The bright spot at the centre of the Fourier transform (FT) of the photograph directly corresponds to the F(0, 0, 0) spot in the diffraction pattern. The diffraction pattern of a crystal is composed of peaks as a result of the periodicity of the crystal (top), whereas the photograph is a `single' object: its FT is `continuous' (bottom).

The crystal is replaced by a two-dimensional digital image that consists of pixels having integer values. It is thus possible to calculate the Fourier transform (FT) of that two-dimensional image, modifying it with user-friendly tools (e.g. removing Fourier coefficients far from the origin) and calculating to which object it corresponds in direct space.

In the following we will first describe how digital images are coded and introduce Fourier transformations, and then we will use the analogy with X-ray diffraction to address some points about resolution, the phase problem in crystallography, and the relation between direct and reciprocal space. Finally, an example showing the important effect of multiple measurements on signal-to-noise ratio will be presented.

Another possible approach is to use Abbe's theory of image formation with a rather simple optical bench, and various examples have been given by e.g. Hecht (2002[Hecht, E. (2002). Optical Physics, 4th ed. San Francisco: Addison Wesley.]), Harburn et al. (1975[Harburn, G., Taylor, C. A. & Welberry, T. R. (1975). Atlas of Optical Transforms. London: G. Bell.]) and Lipson et al. (1995[Lipson, S. G., Lipson, H. & Tannhauser, D. S. (1995). Optical Physics, 3rd ed. Cambridge University Press.]).

2. Digital representation of an image and its Fourier transform

The reference image (Fig. 2[link]) is a digital photograph composed of 256 × 256 pixels coded in 8 bit greyscale [i.e. pixels have integer values from 0 (black) to 255 (white)]. All images used in this practical are in 8 bit greyscale TIFF format and are opened with the pull-down menu option File > Open, or are directly downloaded using the browser. As shown in Fig. 2[link], the mouse pointer is on an almost dark (value = 2) pixel of coordinates (x, y) = (211, 78).

[Figure 2]
Figure 2
Our reference image opened in DigitalMicrograph is composed of 256 × 256 pixels coded in 28 greyscale values, from 0 (black) to 255 (white).

The Fourier transform of an I(n, m) image is defined as

[F(h,k) = \sum\limits_{n = 0}^{N - 1} {\sum\limits_{m = 0}^{N - 1} {I({n,m})\exp[{({{2\pi i} / N})({h n + k m})}}}] \eqno (6)]

(with N = 256 in our example), which is similar to the definition of the structure factor from the electron density [equation (2)[link]]. The inverse Fourier transform is

[I\left({n,m} \right) = {1 \over {N^2 }}\sum\limits_{h = {{ - N} \mathord{\left/ {\vphantom {{ - N} 2}} \right. \kern-\nulldelimiterspace} 2}}^{{N \mathord{\left/ {\vphantom {N 2}} \right. \kern-\nulldelimiterspace} 2} - 1} {\sum\limits_{k = {{ - N} \mathord{\left/ {\vphantom {{ - N} 2}} \right. \kern-\nulldelimiterspace} 2}}^{{N \mathord{\left/ {\vphantom {N 2}} \right. \kern-\nulldelimiterspace} 2} - 1} {F\left({h,k} \right)\exp[{ - ({{2\pi i} / N})\left({hn + km} \right)}}}]. \eqno (7)]

In the following we will limit ourselves to real I(n, m) signals [in our analogy the electron density [\rho ({\bf r})] is a real quantity], which implies that F* (h,k) = F( - h, - k). Moreover, in order to use the fast Fourier transform algorithm implemented in DigitalMicrograph, these images must have square N × N pixel sizes with N a power of two.

Fourier transform calculations can be illustrated on a smaller image (Fig. 3[link]a), composed of only 4 × 4 pixels. Table 1[link] displays the integer values of each of the 16 pixels, and Table 2[link] (visualized in Fig. 4[link]) displays the values of the corresponding Fourier coefficients [note the origin definition (h = 0, k = 0)].

Table 1
Pixel values of Fig. 3[link](a)

  n
m 0 1 2 3
0 127 46 255 241
1 176 179 70 241
2 183 5 190 243
3 196 157 136 94

Table 2
Fourier transform of Fig. 3[link](a)

A complex conjugate relationship (in italics) is visible around the F(0, 0) Fourier coefficient (bold). A graphical representation is given in Fig. 4[link].

  h
k −2 −1 0 1
−2 313 + 0i −301 + 434i 41 + 0i −301 − 434i
−1 −30 + 255i 489i 4883i 2463i
0 127 + 0i 31 + 432i 2539 + 0i 31432i
1 −30 − 255i 246 + 3i 48 + 83i 4 + 89i
[Figure 3]
Figure 3
(a) A small 4 × 4 pixel image. (b) Moduli of the Fourier coefficients of Fig. 3[link](a); symmetry is visible around (h, k) = (0, 0). (c) Phases of the Fourier coefficients of Fig. 3[link](a); antisymmetry is visible around (h, k) = (0, 0). Maximum (minimum) values of moduli and phases are white (black).
[Figure 4]
Figure 4
Representation in the complex plane of two F(h, k) Fourier coefficient couples from Table 2[link].

As can be seen from Table 2[link] and generalizing to an N × N pixel image, the centre of the Fourier transform (h, k) = (0, 0) is placed at the (N/2 + 1)th row and column. This implies, as the original image and its Fourier transform are N × N, that all Fourier coefficients are related by a complex conjugate relationship centrosymmetric about (0, 0), except those in the first row (k = −2) and column (h = −2).

3. Significance of the Fourier coefficients of an image

In order to illustrate the significance of the Fourier coefficients of an image, it is possible to look at which image corresponds to a limited number of Fourier coefficients. As a first example we start from an all-zero 16 × 16 complex image and then set F(−1, 0) = 1 − i, F(1, 0) = 1 + i and calculate its inverse Fourier transform (see Appendix A[link], §A1[link] for the procedure in DigitalMicrograph). This leads to the horizontal sine wave of lowest frequency displayed in Fig. 5[link](a). Then, using F(−h, 0)/F(h, 0) couples, further and further from (0, 0) (Figs. 5[link]b and 5[link]c), one sees that these conditions correspond to sine waves of increasing frequencies. The highest frequency is a special case (Fig. 5[link]c), coded only in one Fourier coefficient, i.e. F(−8, 0); this special treatment for the highest-frequency coefficients simply allows the use of arrays of identical sizes (N × N) for the images and their Fourier transforms. Starting from equation (7)[link] and setting [F({h,0}) = \left| F \right|\exp({i\varphi})], one finds the same results, the recomposed image being

[\eqalign{ I\left({n,m}\right) & = (1/16^2) \big\{ \left|F\right| \exp(-i\varphi) \exp\left[(-2\pi/16)i(-hn+0m)\right] \cr & \quad + \left|F\right| \exp(i\varphi) \exp\left[(-2\pi/16)i(hn+0m)\right] \big\} \cr & = (1/16^2)\, \left|F\right|\,2 \cos\left[(2\pi/16)hn-\varphi\right].}]

The complicated image represented in Fig. 2[link] can thus be seen as resulting from the interference (sum of amplitudes taking into account the relative phases) of the different sine waves generated from each F(h, k)/F(−h, −k) pair. This example also illustrates that Fourier coefficients close to the origin (0, 0) bear information on large-scale intensity variations across the image, whereas the F(h, k) far from the origin encode precise details of the image (this point will be further developed in §4[link]).

[Figure 5]
Figure 5
Complex arrays (upper row, 16 × 16 Fourier coefficients) with only some nonzero Fourier coefficients appearing as white squares (they are Dirac peaks, defined in §3.1[link]), and corresponding images obtained by inverse Fourier transformation (lower row, 16 × 16 pixels). (a) Lowest-frequency horizontal sine wave; (b) intermediate-frequency sine wave; (c) highest-frequency sine wave.

3.1. Dirac delta function and convolution

The two-dimensional Dirac delta function [\delta ({{\bf x} - {\bf x}_0 })] (defined in real space) is non-zero only at position [{\bf x}_0]; one of its properties is to select the value at [{\bf x}_0] of a given function [f({{\bf x}})]:

[ \int\int {f\left({\bf x} \right)\, \delta \left({{\bf x} - {\bf x}_0 } \right) \, {\rm d}{\bf x} = f\left({{\bf x}_0 } \right)}.]

If the Dirac function is centred on the origin [[{\bf x}_0 = ({0,0})]], the Fourier representation of digital images given in §[link]2 [[\delta ({0,0}) = 1]] gives the Fourier transform as simply

[{\rm FT}\left\{ \delta (n,m) \right\} = \sum \sum \delta(n,m) \exp\left[(2\pi i / N)(hn + km) \right] = 1.]

Thus the Dirac delta function [δ(0, 0) = 1] is the inverse Fourier transform of the constant 1:

[\delta(n,m) = {1\over{N^2}} \sum\limits_{h=-N/2}^{N/2-1} \sum\limits_{k=-N/2}^{N/2-1} \exp\left[(-2\pi i/N)(hn+km)\right].]

The convolution between two two-dimensional functions [f({\bf x})] and [g({\bf x})] is defined by

[\left({f \otimes g} \right)\left({\bf u} \right) = \int\int {f\left({{\bf u} - {\bf x}} \right)\, g\left({\bf x} \right) \,{\rm d}{\bf x}},]

and the convolution theorem relates the Fourier transform of the convolution product to the product of the Fourier transforms of the original functions:

[{\rm FT}\left\{ {\left({f \otimes g} \right)\left({\bf u} \right)} \right\} = {\rm FT}\left\{ {f\left({\bf x} \right)} \right\}\, {\rm FT}\left\{ {g\left({\bf x} \right)} \right\}.]

As an example, Fig. 6[link] displays the convolution between a two-dimensional Gaussian function centred at position (x, y) = (200, 200) on a 1024 × 1024 pixel grid, and an image made of four Dirac peaks located at (100, 300), (400, 200), (300, 300) and (450, 450) pixels coordinates (see §A2[link]). The final image is calculated in this example using the convolution theorem, but the result can be seen as being obtained by `applying' the Gaussian function to the four Dirac peaks, taking into account that the Gaussian function is shifted from the origin.

[Figure 6]
Figure 6
Convolution of a two-dimensional Gaussian function with four Dirac peaks.

From a mathematical point of view, this corresponds to [with one Gaussian [g({\bf x})] centred at [{\bf x}_1] and one Dirac peak centred at [{\bf x}_0]]

[\eqalign{ \left({\delta \otimes g} \right) \left({\bf u} \right) & = \int\int \delta \left({{\bf u} - {\bf x} - {\bf x}_0 } \right) \exp\left[{ - \left({{\bf x} - {\bf x}_1 } \right)^2 }\right]\, {\rm d}{\bf x} \cr & = \exp\left[{ - \left({{\bf u} - {\bf x}_0 - {\bf x}_1 } \right)^2 }\right]}]

i.e. a Gaussian centred at [{\bf x}_0 + {\bf x}_1].

3.2. Patterson function

In crystallography, the Patterson function [P({\bf u})], used to solve structures containing heavy atoms, is defined as the autocorrelation function of [\rho ({\bf r})], or in other words as the convolution of [\rho ({\bf r})] with [\rho ({ - {\bf r}})]:

[\eqalign{ P({\bf u}) & = \rho({\bf r}) \otimes \rho({-\bf r})\cr & = \int \rho({\bf r})\,\rho({\bf u}+{\bf r})\,{\rm d}{\bf r}.}]

One important property of [P({\bf u})] is that its Fourier transform is simply

[{\rm FT}\left\{ {P\left({\bf u} \right)} \right\} = \left| F \right|^2, \quad\,\, P\left({\bf u} \right) = {\rm FT}^{ - 1} \left\{ {\left| F \right|^2 } \right\},]

that is to say that unlike electron density [\rho ({\bf r})], this function can be directly computed from experimental [I({\bf H}) \propto \left| {F({\bf H})} \right|^2] data by inverse Fourier transformation.

Starting from the previous image (Fig. 6[link]) composed of the four Gaussian functions that can be seen as analogous to a four-atom structure, the Patterson function can be calculated in different ways, given in §A3[link]. The resulting Patterson function is shown in Fig. 7[link]; it displays 12 peaks around the origin (image centre) corresponding to the N2N = 12 interatomic vectors for the N = 4 `atoms'.

[Figure 7]
Figure 7
Patterson function (b) of the four `atoms' (a).

4. Resolution

4.1. Resolution: aesthetic and quantitative point of view

Starting from the original image (Fig. 2[link]), one wonders how it will be modified if one keeps only a selected part of its Fourier transform. In order to perform such modifications, we use masking tools such as those indicated in Fig. 2[link]A4[link]).

The results using a circular masking tool, displayed in Fig. 8[link], illustrate that the Fourier coefficients far from the origin (centre of the FT) encode details of the image such as the leafs behind the statue, whereas the Fourier coefficients close to the origin encode large-scale intensity variation (e.g. the statue is white on dark background forest).

[Figure 8]
Figure 8
Original image (a) and its Fourier transform (d); low-resolution image (b) corresponding to the FT (e) (with the central zone magnified in the bottom-right inset); high-resolution image (c) corresponding to the FT (f).

For a more quantitative approach we consider Fig. 9[link](a) (256 × 256 pixels), composed of two black disks (15 pixels in diameter) separated by 40 pixels, and ask what is the minimal number of Fourier coefficients that is required for the two disks to be visually separable?

[Figure 9]
Figure 9
Image composed of two black disks separated by 40 pixels (a) and its Fourier transform (b).

One can consider that the lowest frequency necessary to distinguish the two disks corresponds to a sine wave having a periodicity equal to the separation between the disks. From the first part we know that the first Fourier coefficient close to the origin corresponds to a sine wave of one period on the image, i.e. 256 pixels. Thus the sine wave with a period of 40 pixels corresponds to the sixth or seventh Fourier coefficient starting from the origin (256/40 = 6.4). Indeed, as displayed in Fig. 10[link](a), the image reconstructed using only a central area of the first five Fourier coefficients in radius does not permit one to distinguish the two disks, whereas the image calculated with eight Fourier coefficient radii clearly allows one to conclude the presence of two objects on the original image.

[Figure 10]
Figure 10
Images (and horizontal profiles) recomposed from the FTs of Fig. 9(a) on which we selected only a central circular area of five [(a) and (c)] or eight [(b) and (d)] Fourier coefficients in radius.

In our analogy these disks can be seen as two atoms; the shortest interatomic distance that one can expect in a compound is, for example, a C—H bond (∼1 Å). Using the Bragg law [2d\sin \theta = \lambda] and with d = 1 Å, one deduces that the X-ray diffraction experiment has to collect diffracted beams up to diffraction angle [{{\sin \theta}/{\lambda}} = 0.5{\AA}^{-1}] [corresponding to 2θ ≃ 41° for Mo Kα radiation (λ = 0.711 Å)] in order to distinguish H atoms from their neighbours.

4.2. Interpretation of the aesthetic effect of resolution using the convolution theorem

The blurred appearance of the low-resolution image in Fig. 8[link](b) can be explained using the convolution theorem. This image is the inverse FT of the FT of the original image (Fig. 8[link]a), of which we only kept a circular central area. This modified FT can be considered to be the simple product in reciprocal space of the FT of the original image and a circular mask displayed in Fig. 11[link](b). In direct space, the fuzzy image in Fig. 11[link](f) is thus the convolution of the original image and the inverse FT of the circular mask (more examples of FTs of simple objects are given in §6[link]).

[Figure 11]
Figure 11
The images of the lower row are inverse FTs of the corresponding upper-row images.

Indeed, the inverse FT of the circular mask (Fig. 11[link]e) is characterized by four peaks surrounded by oscillations that rapidly decrease in magnitude. It should be noted that the most important contribution to the final image (Fig. 11[link]f) arises from the top-left peak corresponding to the coordinate origin (the three other peaks at the corners create duplicate images outside the boundary of the display but may lead to some artefact close to the edges of the image). The convoluted final image (Fig. 11[link]f) can thus be seen as the sum of copies of the original image shifted and weighted according to the shape of Fig. 11[link](e). In the limiting case of an infinite mask (thus no masking), the inverse FT of the mask is simply a Dirac peak centred on the top-left corner, and the resulting image is then identical to the original one (convolution of the original image with a Dirac peak placed at the origin). If the mask narrows in reciprocal space, its inverse FT widens in direct space (see §[link]6), with increasing contributions far from the top-left corner, and blurring is more and more pronounced in the final image. In the other limiting case the mask is reduced to a single Dirac peak of height 1, of which the inverse FT is a constant image (1/N2). In that case the original image is `totally' blurred, leading to an image having a constant value (which is the average value of the original image).

4.3. Resolution in crystal structure analysis

Assuming that an X-ray diffraction experiment allows the determination of all structure factors in moduli and phases up to 1 Å−1, then, according to the Bragg law, the smallest observable detail without using a model for the structure is 0.5 Å. However, in structure reports, typical estimated standard deviations in C—C bond lengths, for example, are of the order of 0.002 Å, which is far below the diffraction limit. This `extra resolution' is induced by the model inserted to fit the observations (and solve the phase problem); the crystal is composed of atoms of known (usually spherical) shapes. This extra resolution may be misleading because it is strongly linked to the model, and this is not unique; usually one uses spherical atoms (independent atom model, IAM) to model X-ray diffraction data, but atoms are not spherical because of chemical bonds with their neighbours. This asphericity of the valence electron density may be taken into account in more sophisticated atomic models [e.g. multipolar models (Stewart, 1976[Stewart, R. F. (1976). Acta Cryst. A32, 565-574.]; Hansen & Coppens, 1978[Hansen, N. K. & Coppens, P. (1978). Acta Cryst. A34, 909-921.])] and offers precise characterization of interatomic and intermolecular interactions (Lecomte et al., 2005[Lecomte, C., Aubert, E., Legrand, V., Porcher, F., Pillet, S., Guillot, B. & Jelsch, C. (2005). Z. Kristallogr. 220, 373-384.]). Bond distances may be significantly different between the IAM and multipolar models. Dahaoui (2007[Dahaoui, S. (2007). Personal Communication.]) and Espinosa et al. (1997[Espinosa, E., Molins, E. & Lecomte, C. (1997). Phys. Rev. B, 56, 1820-1832.]) performed charge density studies of complexes of tetra­cyano­quinodimethane (TCNQ) with different molecules [benzidine: BD-TCNQ; p-ter­phenyl: PTP-TCNQ; bis(thio­dimethyl­ene)­tetrathia­fulvalene: BTDMTTF-TCNQ; see Appendix B[link]]. Using exactly the same data for IAM and multipolar models on these compounds, the cyano bond distances in TCNQ were 1.1604 (7), 1.1602 (7) and 1.1615 (9) Å for mutlipolar models of BD-, PTP- and BTDMTTF-TCNQ, respectively, but `only' 1.1539 (9), 1.1532 (7) and 1.1551 (10) Å for the corresponding IAM models. These bond lengths differ between the two atomic models by as much as Δ/σ = 7.2, 10 and 6.4 for BD-, PTP- and BTDMTTF-TCNQ, respectively, σ being the larger bond length standard deviation from the two models. The reason for these significant discrepancies between IAM and multipolar models is illustrated in Fig. 12[link], where the static deformation density through the TCNQ molecular plane is plotted. This density is defined as the difference between the electron density derived from the multipolar model and the electron density of the corresponding IAM model, and thus it shows the redistribution of valence electron density due to chemical bonding. As can be seen from this figure, the valence density in C≡N bonds is strongly shared between the two atoms, leading to a substantial displacement of the electronic centroids of both the C and the N atoms and therefore to a biased bond length if an IAM model is used.

[Figure 12]
Figure 12
Static deformation density of TCNQ (multipolar density minus IAM density) showing the redistribution of valence electrons as a result of chemical bonding (contour intervals are at the 0.1 e Å−3 level; solid lines are positive, dotted lines are negative, and the zero contour is dashed) (Dahaoui, 2007[Dahaoui, S. (2007). Personal Communication.]).

Consistent with that finding but in a different way, Seiler et al. (1984[Seiler, P., Schweizer, W. B. & Dunitz, J. D. (1984). Acta Cryst. B40, 319-327.]) showed that, for a given refinement model, structural parameters depend on the data set extension used to refine these parameters. Their compound (tetrafluoro­terephthalonitrile) also possesses a C≡N bond whose length converged from an IAM refinement to 1.1489 (8) Å using all of the structure-factor data set (sinθ/λ < 1.15 Å−1); however, this distance increased to 1.1538 (4) Å if only high-order data were used (0.85 Å−1 < sinθ/λ < 1.15 Å−1). This underestimation of bond lengths when using an IAM model is explained by the fact that valence electrons (responsible for biased interatomic distances) contribute mainly to low-order reflections (see §[link]6 for an explanation of valence/core contributions to diffraction).

This biasing of bond distances is mainly encountered in strongly polar interactions, where the electron density is shared between atoms. An even more obvious example is X—H bonds (X = C, N, O), in which the distance can be underestimated by as much as 0.1 Å when using an IAM model. Because H atoms have their electronic clouds strongly deformed in such bonds, one must use neutron nuclear diffraction (where neutrons interact with nuclei, not with electrons) to perform a precise structure determination or charge density modelling.

5. Phase and modulus

In this section we consider the relative importance of the modulus and phase of the Fourier coefficients. Starting from two images (Figs. 13[link]a and 13[link]b), one can extract the moduli and phases of their respective Fourier transforms and recombine them (modulus of FT of image a with phase of FT of image b and reciprocally; see §A5.1[link]). As shown in Fig. 14[link], the images obtained are closer to the image from which we took the phase than that one from which we extracted the modulus.

[Figure 13]
Figure 13
Two images (a) and (b), and the Fourier transform of (a) represented as the log of its modulus (c) and its phases (d).
[Figure 14]
Figure 14
Images obtained by combining the moduli and phases of the FTs of the images given in Figs. 13[link](a) and 13[link](b): (a) moduli of Fig. 13[link](b) and phases of Fig. 13[link](a); (b) moduli of Fig. 13[link](a) and phases of Fig. 13[link](b). This shows that the phases are more important than the moduli.

It is also possible to use random moduli (Fig. 15[link]a) or random phases (Fig. 15[link]b): one has to note, however, that in order to obtain real images the relation [F({ - \bf H}) = F^* ({\bf H})] around (h, k) = (0, 0) must be imposed on these random values and this could be achieved using more complex scripts (§A5.2[link]).

[Figure 15]
Figure 15
Image (a) composed with random moduli and phases of image Fig. 13[link](a); Image (b) composed with random phases and moduli of image Fig. 13[link](a). This shows that phases are more important than moduli.

Each pixel of an image built from a Fourier transform (i.e. using an inverse Fourier transform operation) is the result of the interference (addition in the complex plane) of the contributions of each Fourier coefficient (Fig. 16[link]). If phases are strongly modified, the resulting amplitude will be strongly affected. Comparing Fig. 14[link](a) (created with moduli of Fig. 13[link]b) and Fig. 15[link](a) (created with random moduli), one can easily see that the former is closer to the original image (Fig. 13[link]a); this is explained by noting that the moduli of Fig. 13[link](b) `resemble' more closely the moduli of the original image Fig. 13[link](a) (with a central strong peak and decreasing Fourier coefficients away from the centre), whereas the random moduli used here are uniform in reciprocal space.

[Figure 16]
Figure 16
The intensity at a pixel is proportional to the sum of the Fourier coefficients [here φ(h, k) includes the spatial propagation phase term].

The importance of the phases relative to the moduli is also evidenced by repeating these examples with different sets of random phases or moduli. Whereas the images (not shown here) composed with random moduli are aesthetically very similar (one can recognize the edges of the statue), the images obtained with random phases are clearly different from one another and do not resemble the original object.

6. Shape and symmetry relations between direct and reciprocal space

6.1. Fourier transformation of individual objects

In order to explain, for example, the `shape' of the Fourier transform of a crystal or the contributions of core and valence electron densities to diffraction, one must illustrate the relations between direct and reciprocal space.

Fig. 17[link] underlines the well known Fourier transform property that a shape-restricted object (direct space) corresponds to an extended Fourier transform and vice versa (Figs. 17[link]a–17[link]d). Also evident is the symmetry relationship between the two spaces: a cylindrical object (Fig. 17[link]a) will have a cylindrical FT (Fig. 17[link]b); a rectangular object (Fig. 17[link]e) will have an FT (Fig. 17[link]f) that is an assembly of rectangles but with their smallest extension in the same direction as the greatest dimension of the object. The polygon displayed in Fig. 17[link](g) has then an FT characterized by tails perpendicular to its edges, since this object has restricted extension along these directions [the five edges of the polygon give rise in the FT (Fig. 17[link]h) to five tails crossing at the origin]. Remembering images of the sun recorded in movies (often observed as a disk surrounded by six tails), one recalls that usually hexagonal diaphragms are used in front of the camera.

[Figure 17]
Figure 17
Relations between direct and reciprocal space. To a small disk (a) corresponds a large Fourier transform (b) and vice versa [(c) and (d)]. A rectangular object (e) gives rise to a rectangular FT (f), the largest extension of which corresponds to the thinner direction of the object. A complex object such as the polygon (g) results in an FT (h) (with the central zone magnified in the bottom-right inset), having extensions in directions perpendicular to the faces of the object.

Starting from Fig. 17[link](e) one can see that the FT of an infinite vertical slit is obtained from Fig. 17[link](f) where the horizontal oscillations are kept (they are linked to the slit width) but the vertical ones are condensed in the horizontal direction. Adding a second vertical slit leads to interference (Young's two-slit experiment), where the spacing between the minima is linked to the slit separation (Fig. 18[link]d). If more and more equidistant slits are inserted, secondary maxima of decreasing height are created between the principal maxima, which sharpen, and in the limiting case of an infinite number of slits giving rise to a lattice, the Fourier transform becomes a Dirac row (Fig. 19[link]).

[Figure 18]
Figure 18
From slits to lattices. The combination of two slits (a) leads to interferences (d), where the spacing between minima is linked to the slit separation. Adding more and more slits [(b) and (c)] creates secondary maxima of decreasing intensity between the principal maxima [(e) and (f)].
[Figure 19]
Figure 19
Fourier transform (b) of a one-dimensional vertical lattice (a) (the width of the Dirac peaks is exaggerated for clarity).

A two-dimensional lattice can then be constructed by crossing vertical and horizontal one-dimensional lattices, as displayed in Fig. 20[link](a). This lattice being infinite, its Fourier transform is then also a lattice [in Fig. 20[link](b) the Dirac peaks are artificially enlarged for clarity]. The direct lattice (Fig. 20[link]a) can be seen as the convolution of a Dirac peaks lattice and the motif composing the `unit cell' (Fig. 20[link]d): indeed, its Fourier transform is the simple product between the reciprocal lattice (FT of the direct lattice) and the FT (Fig. 20[link]e) of the motif (Fig. 20[link]d). The two black horizontal lines In Fig. 20[link](b) arise from the fact that a node of the FT (Fig. 20[link]e) falls on the same position as a row of the reciprocal lattice that samples this function.

[Figure 20]
Figure 20
Two-dimensional lattice (a) and its Fourier transform (b). The intensity variation (c) across the horizontal line of (b) arises from the Fourier transform (e) of the motif (located in any unit cell) (d), which decorates the lattice (a).

Returning to crystallography, the crystal is the convolution of a three-dimensional direct lattice with a motif that describes or `decorates' the unit cell; its Fourier transform (related to the diffraction pattern) is then the simple product of the reciprocal lattice, giving rise to sharp diffraction spots [it is the interference function [\Gamma ({\bf H})] of equation (1)[link] in the case of a large number of unit cells], with the FT of the motif, which is the structure factor [F({\bf H})] which leads to intensity variations from spot to spot and to (non-lattice) systematic extinctions.

The structure factors are the sum of the contributions of the Nat different atoms composing the unit cell:

[F\left({\bf H} \right) = \sum\limits_{j = 1}^{N_{\rm at} } {f_j \left({\bf H} \right) \exp \left({2\pi i{\bf H} \cdot {\bf r}_j}\right)},]

where [f_j ({\bf H})] is the atomic scattering factor of atom j and is the Fourier transform of its electron density. Electrons of non-H atoms may be defined as core and valence electrons and have distinct contributions in reciprocal space because of their different locations in real space. As shown in Fig. 21[link] the iron core electrons tightly bound to the nuclei contribute in the whole diffraction angle range, whereas valence electrons spread in direct space have noticeable contributions only for small diffraction angles, i.e. close to the origin of the reciprocal space owing to the FT properties. This implies that in charge density (in which one wants to observe and model the distribution of valence electrons) or accurate thermal motion studies one has to collect accurately low- and high-diffraction-angle reflections in order to distinguish valence effects from thermal displacements (static or dynamic) since the FT of the structure factors is the thermally smeared electron density (Coppens, 1997[Coppens, P. (1997). X-ray Charge Densities and Chemical Bonding, IUCr Texts on Crystallography. Oxford University Press.]) [see Aubert et al. (2003[Aubert, E., Porcher, F., Souhassou, M. & Lecomte, C. (2003). Acta Cryst. B59, 687-700.], 2004[Aubert, E., Porcher, F., Souhassou, M. & Lecomte, C. (2004). J. Phys. Chem. Solids, 65, 1943-1949.]) for an example of charge density and electrostatic potential studies].

[Figure 21]
Figure 21
Atomic scattering factor of Fe and Fe3+ as a function of diffraction angle θ. These two curves only significantly differ for low diffraction angles where the contribution of valence electrons is the strongest.

6.2. Effect of the crystal shape

In single-crystal X-ray diffraction a typical size of the specimen is about 100 µm in length in each direction, the optimal size being a compromise between the diffracting power proportional to the crystal volume and the absorption phenomenon. Crystal size has a less important effect with the X-ray technique than it has in electron diffraction, where the crystal must be very thin to be transparent to the electron beam (Williams & Carter, 1996[Williams, D. B. & Carter, C. B. (1996). Transmission Electron Microscopy. New York: Plenum Press.]).

Given the infinite perfect crystal displayed in Fig. 22[link](a), one wonders how its diffraction pattern will be modified if its shape is changed. Because the crystal is infinite, its Fourier transform is a regular array of Dirac peaks of varying heights across the image.

[Figure 22]
Figure 22
An infinite perfect crystal (a) and its Fourier transform (b).

According to what was seen in the preceding section, if one restricts the object shape in one direction its Fourier transform will expand in that direction. Examples of different crystal shapes are given in Fig. 23[link], together with their Fourier transforms. These latter can be explained using the convolution theorem: in direct space, the finite size crystal can be seen as the simple product of the infinite crystal with a mask giving the crystal shape; in reciprocal space the Fourier transform of the finite crystal is then the convolution of the Fourier transform of the infinite crystal (array of Dirac peaks) by the Fourier transform of the mask.

[Figure 23]
Figure 23
A rectangular crystal (a) and its Fourier transform (b). The extension of the FT is larger in the direction where the crystal is thinner. A spherical crystal (c) and its Fourier transform (d). The Fourier transforms are the convolution of the FT of the infinite crystal with the FT of the shape of the finite crystal.

6.3. Playing: bird in cage…

As a recreation, one can play with the well known example of the captive bird shown in Fig. 24[link](a), the aim being to release the flying animal. As displayed in Fig. 24[link](b) one can recognize the respective contributions of the bird (complex intensity variation with a global decreasing from the origin) and of the cage (which is a simple vertical one-dimensional lattice) giving rise to sharp spots in the equatorial line. The bars of the cage will then disappear if one masks their contributions in the reciprocal space as in Fig. 24[link](c). The final image still displays traces of the bars because the cage contribution spreads beyond the section that was hidden. In direct space, the original image is the simple product of the bird and of the cage; thus in reciprocal space it corresponds to the convolution of the FT of the bird on the Dirac peaks of the FT of the cage.

[Figure 24]
Figure 24
How to release a captive bird. The original image is in (a) and its FT in (b). By removing with a mask part of the contribution of the bars in the FT (c) the cage `disappears' in direct space (d).

7. Signal on heavy noise

As a final application, we present an example related to electron microscopy; in Fig. 25[link](a) are displayed 20 objects that are assumed to be identical and related by translation only (i.e. no rotation). As can be seen, the high noise level allows the identification of these objects on the image but precludes the observation of the possible details inside them. Because the noise is assumed to be random across the image, one can thus average the 20 objects in order to increase their signal to noise ratio (§A6[link]).

[Figure 25]
Figure 25
(a) 20 identical objects are spread on a random high-level noise. (b) Zoom on three objects; the noise level precludes any signal detection inside the objects.

The first step is to find the precise position of each object on the image; one extracts one of the objects (Fig. 26[link]a) and computes the cross correlation between this extracted object and the full image. The result, shown in Fig. 26[link](b), displays sharp peaks corresponding to the repetitive positions of the extracted object on the original image (these peaks give the coordinates in the image frame of the top-left corner of the square selection that have to be used to extract and average the 20 objects). The average image (Fig. 27[link] after adequate rotation) is then obtained by summing the objects extracted from the original image using the coordinates derived from the cross correlation; it reveals the weak signal hidden by the high level noise.

[Figure 26]
Figure 26
(a) One extracted object placed in a new otherwise zero image. (b) Cross correlation between the original image (Fig. 25[link]a) and the extracted object (a).
[Figure 27]
Figure 27
Average of the 20 objects extracted from Fig. 25[link](a) (after 120° rotation), revealing the weak signal hidden in the noise.

This example of utilization of correlation also illustrates the importance of multiple measurements of structure factors in single-crystal X-ray diffraction in order to increase their signal-to-noise ratio. This is of the utmost importance, for instance, in charge density modelling, where the effect to be observed (i.e. electron density reorganization owing to chemical bonding) is weak.

8. Conclusions

This paper illustrates the Fourier transformation and its properties used in crystallography with emphases on X-ray diffraction. Obviously, the demonstrations are not restricted to crystallographic applications but are relevant to all domains where Fourier transformation, convolution, correlation, resolution etc. are important. The example of X-ray imaging that uses synchrotron and the promising free electron laser sources is particularly relevant. Figs. 17[link](b) and 17[link](f) of the present paper correspond to Figs. 7 and 8 of the Livet lead article on diffraction with an X-ray coherent beam (Livet, 2007[Livet, F. (2007). Acta Cryst. A63, 87-107.]).

Some other examples of image manipulations are given at https://www.lcm3b.uhp-nancy.fr/lcm3b/Pages_Perso/Aubert/sommaire.html . These illustrations show, for example, how to use Fourier transform for zooming on an image or to insert a digital signature into a photograph.

The free demonstration version of DigitalMicrograph software is available from Gatan (https://www.gatan.com/imaging/downloads.php ).

APPENDIX A

Procedures and scripts used for the examples developed in the text

A1. (§3[link]. Significance of the Fourier coefficients of an image)

File > New > Width 16 Height 16 Complex 8 Bytes Constant (0)

Object > Display Type > Spreadsheet

Modify F(h, k) by double click on it

Object > Display Type > Raster

Process > Inverse FFT

Object > Display > Complex Display Real Part

A2. (§3.1[link]. Convolution)

File > New > 1024 1024 Real 4 Ramp X → Image A

File > New > 1024 1024 Real 4 Ramp Y → Image B

File > New > 1024 1024 Real 4 Constant 0 → Image C

File > New > 1024 1024 Real 4 Constant 0 → Image D

In one script:

c = exp(-1e-3*((a-200)**2+(b-200)**2))

d = 0

d[100,300] = 1

d[400,200] = 1

d[300,300] = 1

d[450,450] = 1

Process > FFT on images C and D (results in E and F)

Process > Simple Math > E*F (results in G)

Process > Inverve FFT on G (results in H)

Edit > Change Data Type > Real > Real Component

A3. (§3.2[link]. Patterson function)

Directly using the implemented function:

Process > Auto correlation (results in I)

Using the convolution theorem:

Process > Rotate 180° (results in J from H)

iFFT on the product of FFT of H and FFT of J

Using the relation [P\left({\bf u} \right) = i{\rm FT}\left\{ {\left| F \right|^2 } \right\}]: calculate [\left| {F\left({\bf H} \right)} \right|^2] from H:

Process > FFT (result in J)

Edit > Change Data Type > Real > Modulus

Process > Simple Math > a**b with b = 2 (results in K)

Edit > Change Data Type > Complex

Process > Inverse FFT

A4. (§4.1[link]. Resolution: aesthetic and quantitative point of view)

Open image

Process > Fourier Transform

Apply the masking tool to that FT

Process > Apply Mask

Process > Inverse FFT

A5. (§[link]5. Phase and modulus)

A5.1. Open the two images (results in A and B)

Process > Fourier Transform on these two images (results in A, B → C, D)

mp = complex(modulus(c)*cos(phase(d)), modulus(c)*sin(phase(d)))

pm = complex(modulus(d)*cos(phase(c)), modulus(d)*sin(phase(c)))

A5.2. With random moduli and phases of the Chinese Musician:

File > New > 256 256 Real 4 Random (image A)

In a script: (image C)

b = a[1,1,256,256]

FlipHorizontal(b)

FlipVertical(b)

c = a

c[129,1,256,256] = b[128,0,255,255]

deleteimage(b)

d = c[128,1,129,256]

FlipHorizontal(d)

c[128,1,129,128] = d[0,0,1,127]

deleteimage(d)

d = c[0,1,1,256]

FlipHorizontal(d)

c[0,1,1,128] = d[0,0,1,127]

deleteimage(d)

d = c[1,0,256,1]

FlipVertical(d)

c[1,0,128,1] = d[0,0,127,1]

deleteimage(d)

Open image of the Chinese Musician (image B)

Process > FFT (image D)

z = complex(c*cos(phase(d)),c*sin(phase(d))) (image Z)

Process > Inverse FFT (Z → E)

Edit > Change Data Type > Real > Real Component (on E)

With random phases and moduli of the Chinese Musician:

File > New > 256 256 Real 4 Random (image A)

In a script: (image D)

b = (a-0.5)*2*pi()

c = b[1,1,256,256]

FlipHorizontal(c)

FlipVertical(c)

d = b

d[129,1,256,256] = -c[128,0,255,255]

e = d[128,1,129,256]

FlipHorizontal(e)

d[128,1,129,128] = -e[0,0,1,127]

deleteimage(e)

e = d[0,1,1,256]

FlipHorizontal(e)

d[0,1,1,128] = -e[0,0,1,127]

deleteimage(e)

e = d[1,0,256,1]

FlipVertical(e)

d[1,0,128,1] = -e[0,0,127,1]

deleteimage(e)

deleteimage(b)

deleteimage(c)

d[0,0] = 0

d[128,128] = 0

d[0,128] = pi()

d[128,0] = pi()

Open image of the Chinese Musician (image B)

Process > FFT (image C)

z = complex(modulus(c)*cos(d),modulus(c) *sin(d)) (image Z)

Process > Inverse FFT (Z → E)

Edit > Change Data Type > Real > Real Component (on E)

A6. (§7[link]. Signal on heavy noise)

Open the 20 object image (image A)

Draw a square 256 × 256 pixel selection around a given object

File > New > 2048 2048 Real 4 Constant (a) (image B)

In a script: b[0,0,256,256] = a[]

Now we have to compute the cross correlation between A and B:

[C\left({\bf u} \right) = \int {A\left({\bf x} \right)\, B\left({{\bf x} + {\bf u}} \right) \, {\rm d}{\bf x}},]

which can be seen as the convolution of [A({\bf x} )] with [B({ - \bf x} )].

Process > Rotate (180°) (image B → image C)

Process > FFT (A → D)

Process > FFT (C → E)

Process > Simple Math (D × E → F)

Process > Inverse FFT (F → G)

APPENDIX B

Diffraction data

BD-TCNQ: space group: C2/m; temperature: 100 K; sinθ/λmax = 1 Å−1; multipolar model: R = 0.023, Rw = 0.024; g.o.f. = 0.605; IAM: R = 0.038, Rw = 0.049, g.o.f. = 1.208. PTP-TCNQ: space group: [P\bar 1]; temperature: 120 K; sinθ/λmax = 1.09 Å−1; multipolar model: R = 0.031, Rw = 0.032, g.o.f. = 1.476; IAM: R = 0.045, Rw = 0.048, g.o.f. = 2.122. BTDMTTF-TCNQ: space group: C2/m; temperature: 15 K; sinθ/λmax = 1.14 Å−1; multipolar model: R = 0.027, Rw = 0.025, g.o.f. = 0.957; IAM: R = 0.035, Rw = 0.037, g.o.f. = 1.397.

Acknowledgements

The authors thank Dr Eric Chabrière for fruitful discussions, and Professor Enrique Espinosa and Angélique Lagoutte for their help during the practical training session at the CNRS thematic school `Structural Analysis by X-ray Diffraction, Crystallography under perturbation' held in Nancy in September 2006. EA thanks Dr S. Pillet for the invitation to this CNRS school. We are grateful to Dr Slimane Dahaoui for providing accurate bond lengths and charge density results on TCNQ complexes, before publication, and to the referees for constructive comments and corrections of the manuscript.

References

First citationAubert, E., Porcher, F., Souhassou, M. & Lecomte, C. (2003). Acta Cryst. B59, 687–700.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationAubert, E., Porcher, F., Souhassou, M. & Lecomte, C. (2004). J. Phys. Chem. Solids, 65, 1943–1949.  Web of Science CrossRef CAS Google Scholar
First citationCoppens, P. (1997). X-ray Charge Densities and Chemical Bonding, IUCr Texts on Crystallography. Oxford University Press.  Google Scholar
First citationDahaoui, S. (2007). Personal Communication.  Google Scholar
First citationDumas, P., Vanwinsberghe, J. & Cura, V. (2006). Crystallographic Teaching Commission of the IUCr Newsletter, No. 1, pp. 4–10.  Google Scholar
First citationEspinosa, E., Molins, E. & Lecomte, C. (1997). Phys. Rev. B, 56, 1820–1832.  CrossRef CAS Web of Science Google Scholar
First citationHansen, N. K. & Coppens, P. (1978). Acta Cryst. A34, 909–921.  CrossRef CAS IUCr Journals Web of Science Google Scholar
First citationHarburn, G., Taylor, C. A. & Welberry, T. R. (1975). Atlas of Optical Transforms. London: G. Bell.  Google Scholar
First citationHecht, E. (2002). Optical Physics, 4th ed. San Francisco: Addison Wesley.  Google Scholar
First citationLecomte, C., Aubert, E., Legrand, V., Porcher, F., Pillet, S., Guillot, B. & Jelsch, C. (2005). Z. Kristallogr. 220, 373–384.  Web of Science CrossRef CAS Google Scholar
First citationLipson, S. G., Lipson, H. & Tannhauser, D. S. (1995). Optical Physics, 3rd ed. Cambridge University Press.  Google Scholar
First citationLivet, F. (2007). Acta Cryst. A63, 87–107.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationSchoeni, N. & Chapuis, G. (2006). https://lcr.epfl.ch/page37304.html  Google Scholar
First citationSeiler, P., Schweizer, W. B. & Dunitz, J. D. (1984). Acta Cryst. B40, 319–327.  CSD CrossRef CAS Web of Science IUCr Journals Google Scholar
First citationSpence, J. C. H. & Zuo, J. M. (1992). Electron Microdiffraction. New York: Plenum.  Google Scholar
First citationStewart, R. F. (1976). Acta Cryst. A32, 565–574.  CrossRef CAS IUCr Journals Web of Science Google Scholar
First citationWilliams, D. B. & Carter, C. B. (1996). Transmission Electron Microscopy. New York: Plenum Press.  Google Scholar

© International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.

Journal logoJOURNAL OF
APPLIED
CRYSTALLOGRAPHY
ISSN: 1600-5767
Follow J. Appl. Cryst.
Sign up for e-alerts
Follow J. Appl. Cryst. on Twitter
Follow us on facebook
Sign up for RSS feeds