Fourier analysis and structure determination. Part I. Fourier transforms

Fourier analysis and structure determination. ... and III for the discussions of NMR imaging and X-ray crystal structure analysis. ... Citing Articles...
0 downloads 0 Views 5MB Size
Fourier Analysis and Structure Determination Part I: Fourier Transforms John P. Cheskk Haverford College, Haverford, PA 19041 Nuclear magnetic resonance (NMR) has been a versatile analvtical and nhvsical tool for the chemist for over three decahes. In the'& two years the principles and practice of NMR have come to a technoloaical fruition as a method of producing clinically useful images of sections of anatomy. Magnetic resonance imaging seems t o he supplanting the Xray CAT scanner for. a large fraction of clinical applications. This new imaging technique requires more knowledge of principles and parameters for its fullest exploitation by the practitioners than did the CAT scan method, making NMR theory and practice of greater importance to chemical/bioscience educators. NMR imaging applications to date have been chiefly in the area of gross organism structure. The NMR microscope, however, is on the horizon as a possible tool for examination of small-scale svstems. The theorv of NMR imaging also has a striking formal similarity to that of the other verv. hinh - resolution imaainp tool of traditional importance to the chemist, X-ray cr;stil structure analysis. Fourier analysis and Fourier transform theory are the mathematical tools providing the formal link between these methods as well as beinpnecessary and useful in other areas. Fourier transform spedtrometershave been in increasingly general use in NMRJR, and mass spectrometry, and chemists need a meater awareness of and caoabilitv in the use of the associated mathematics for discussion, understanding, and usaee of this instrumentation. We Govide the following as a preview of topics t o be discussed in this three-nart series. The unit cell of a single crystal contains the molecular structure information usually desired hv the chemist. This is analoaous to the whole sample observed in an NMR imaging experiment, such as a human head. In both cases the physics of the experiment dictates that the observed intensity data set, either scattered X-rays or emitted radio frequency signals, is related through a three-dimensional Fourier transform to the structure of the sample. The fact that the crystal is a three-dimensional reoetition of the unit cell limits the observation of the X-rav signals to fixed lattice points in the space of the ~ o u f i e r transform of the crystal's unit cell. The X-ray precession or Weissenberg diffraction camera pictures produced by a sinele crvstal show mots instead of continuous shading as a resuliof this. In the NMR imaging experiment, a ~Gurier transform of the head is ex~erimentallvobserved a t regulartransformspace, hut incontrast ly spaced poinrsin a ~ourie-r to the X-ray diffraction case, these points are at the control of the experimenter. The desired "pictures" of the unit cell of the crystal asan X-ray diffraction sample or of the human head as an NMK imager sample are obtained by finding the corresponding inverse Fourier transform of the data set. However. ouite different ~roblemsarise in doinr this for the X-ray and^forthe NMR imaging cases. In this part, Part I, we will try to provide a brief introduction to Fourier analysis and some definitions and properties of Fourier transforms that are needed in Parts I1 and I11 for the discussions of NMR imaging and X-ray crystal structure analvsis. We attempt to show relations, wavs of understanding the mathematics, and applications. The reader must consult the references for proofs. ~~~~~~~~

~

~

~

-

128

Journal of Chemical Educatlon

Griffiths' has provided a review volume giving some Fourier transform theorv and techniques for using these transforms in a variety df chemical applications, excluding the NMR imaging case. Foskett's chapter' in this book provides a brief introduction to Fourier tramform theory. Hamirez3 gives an excellent treatment ofthe Fourier transform for the beginner with many graphical examples. The texrs of Brigham4 and Bracewells are particularly recommended for more comnlew mathematical detail and oroofs at a level that is reasonably accessible totheinterestedchemist. It is hoped that the exolicit use of Fourier transforms in the discussion here will continue t o encourage chemical educators to work for the inclusion of these methods in the mathematical tool kits of chemistry students. Fourler Series for Representation of Periodlc Structures Let us consider y ( t ) as a function of one variable that is periodic in this variable, repeating with period 7.The correspondingfrequency for the repetition fo = 117.We might not really care if the function actually repeatsoutside of one cycle, 0 5 t 5 7 , as long as it behaves a t the boundaries as though i t repeated. We may represent this function as an infinite series of sin and cos functions, a Fourier series, whose frequencies are integer multiples of fo, or At) = Ad2 +

-

+

(A, cos (2mnfot) B, sin (2snf,t))

(1)

n=,

Equations 2a and 2b are derived by multiplying eq 1by any one of the cos or sin functions and integrating the resulting equation over the period 7.The cos and sin functions are orthogonal when multiplied and integrated over one period 7,and all the terms hut one in the resulting sum of integrals vanish to give eq 2a or 2h for the coefficient A, or B, of the cos or sin term chosen. Equation 2 permits us to do a Fourier spectral (frequency) analysis of the periodic function y ( t ) . Equation 1 with coefficients from eq 2 permits us to do a synthesis or construction of a wave form using simple sin and cos functions as building blocks. By the choice of a finite upper limit for n in the summation of eq 1 we can make whatever compromise we feel necessary in trading accuracy of representation for computational speed.

' Grifflths, P. R.. Ed. Transform Techniques in Chemistry. Plenum: New York, 1978. Foskett, C. T., Chapter 2 in Griffiths (footnote1). Ramirez. R. W. The FFT. Fundamentalsand Concepts: PrenticeHall: ~nglewoodCllffs. NJ, 1985. Brigham, E. 0.The Fast Fourler Transform: Prentice-Hall: Englewood Cliffs. NJ. 1974. Bracewell, R. N. The Fourier Transform and ib Applications: McGraw-Hill: New York. 1978.

Figure 1. (a) S q w e wave of lrequency fo = llr.. (b) A,. Fourier cos series coefficient. Frequency in units of f,.

Figure 2. (a) Train of pulses of width r d 2 , period 37012. (b) C, complex Fourier series coefficient. Frequency in units of fo = 11~0.

As an example, consider a square wave of frequency fo Hz. This function, shown in Figure la, is periodic with period ro = l/fo. This periodic square wave may be represented by a Fourier series, eq 1, hut the choice of the origin and the symmetry of the square wave gives B, = 0 for all n (using eq 2h) and therefore eq 1 simplifies to a cos series representation. The coefficient A, of the cos term of frequency nfo in eq 1is found as an integral over a period r o of the square wave, eq 2a. The resultingvalues of A, are shown in Figure lh. One can see the product nfo as a frequency parameter in eqs 1-3, and the horizontal axis of Figure l b displays frequency as the variahle in units of fo. A shift of the wave form along the time axis would introduce non-zeroB, values, and sin terms would therefore appear in the series representation of the square wave. With this series representation of the square wave, we have by means of eq 2 the frequency analysis of the square wave. Using eqs 1 and 2 we can also notice the inverse relation between the spacings of the features in Figures l a and lb. As the frequency fo is increased by decreasing the period ro, the square wave compacts on the time axis and the frequency spectrum expands on the frequency axis. The equations 1and 2 for Fourier series representation of a function with period r = l/fo may be reworked to give equivalent complex forms that will be more suitable for our use than the real number forms of eas 1and 2. The A~nendix contains a short summary of compleK variahle relations used in these discussions. Bv substitutine the comolex exDonential identities for the &I and cos f u k i o n s and also'noting the effects of negative n values in eqs 1and 2, we obtain

Fourier Transforms

with the following relations between the forms of the coefficients

C. = ( A , - iB.112 A_" = A, B_" = -B,

C_"= c;

(5)

The representation of an isolated pulse may he approached by increasing the intervals between the pulses in a periodic pulse train. Figure 2a shows a pulse train with a relatively longer interpulse interval than that of Figure la. The width of the pulse is held a t ro/2 as in Figure la, but the pulses have been spaced so that the period of the wave is now longer than 70. Figure 2b shows the corresponding values of C, as computed by eq 4. The B, coefficients of the sin terms are still zero through the choice of origin, each C, is a real number, and a cos series still representsthe spaced-out pulse train. More frequencies are represented in the same range in the series representation although the envelope of thefrequency spectrum shown in Figure 2b is the same as it was in Figure l b when frequency is measured in units of fo = 1/70. If we now further increase the interval between the pulses while holding constant the widthof eachpulse, we find in the limit of infinite separation of pulses, where fo 0 and .r m, that the sums ineqs 3 and 4 become the integrals in eqs6 and 7.

- -

The coefficient C, in the Fourier series has become C O , a continuous function of the frequency f, in eqs 6 and 7. Our square wave example becomes a single square pulse of the same width 7012 centered a t the time origin as shown in Figure 3a. For this y ( t ) , eq 7 integrates to give the sinc function as the result for C O , or C(n = (7012)sin (1Tf/(2f0))/ (uf/(2f0)), where fo = 1/70 as before. Figure 3b displays this result for this single pulse. Figure 3b is the frequency representation, the spectral analysis of this single square pulse. The sin integral in eq 7b vanishes for our choice of the origin at the center of the pulse, the imaginary component of C(f) is zero, and C O is a real function. We now have a continuous range of frequencies in our cos "series" representation of the pulse. One sees that Figure l b appears to he a sampling of Figure 3b a t intervals of fo = 11q Hz. Figure 2h also appears to be a sampling of Figure 3h a t smaller intervals. A different choice of origin and/or a less symmetrical shape for the pulse would have introduced sin terms into the Volume 66 Number 2

February 1989

129

terval 6f. The continuous variables t and f are then replaced by n6t and kdf, where n and k are integers. The eqs 6 and 7 for the continuous Fourier transforms become eqs 8 and 9 for the discrete Fourier transforms (DFT). N-l

C(k6fl exp (2ri(k6fl(n6t))

y(n6t) = 6f k=O

N-l

C(k6fl = 6t

y(n6t) exp (-2ri(k6fl(n6t)) n=o

original Fourier series for the periodic pulse train, and the integrals for the single pulse in eqs 6 and 7 would also have had sin terms. This implies that C, for the periodic pulse train would have had an imaginary component, and that CV) for such a pulse would alm have required two curves t o display both the real and ima~inarvcomoonents instead of thisingle curve shown in ~ i ~ u3rbe Equation 7 defines the Fourier transform of the pulse y(t) in the time domain to obtain the amplitude spectrum CV) in the frequency or inverse time domain. Equation 6 is the inverse Fourier transform of C(n giving the time-dependent pulse y(t) from the frequency representation. The complex form Preserves nhase relationshins and svmmetw orooerties of the sin and eos function components:~t is also necessary to cope with these comnlexforms if one is touse the methods and ;elated texts or litkrature of Fourier transforms. Our one-dimensional examples have related a time-varying function to a corresponding frequency spectrum. In this example time and freauency are inversely related as variables: However, the mathematics can define similar relations between functions with related independent variables, such as afunction of acartesian coordinate x and atransformation related function in "reciprocal space" with a coordinate orooortional to llx. The mathematical relationshins in eqs 6'ank 7 may also be extended to two- and three-dimensional problems, for example relating a function in three dimensional Cartesian coordinate space to a transformed function in another related three-dimensional reciprocal space. Examination of eqs 6 and 7 shows that the signsin the exponentials may be interchanged and that either one of the pair of the equations might he designated as the Fourier transform if the other equation of the pair is then designated as the inverse transform. The choice is arbitrary. Application of theFourier transformto a function followed by appli- cation of the inverse transform regenerates the original function.

.

u.

~

The following relations state important consequences of the sampling procedure chosen: (a) The frequency resolution is determined by the total observation time, or 6f = lI(N6t). (b) The frequency maximum that can be considered for the waveform sampled, the Nyquist frequency f ~is. determined by the time interval t between samplings,or f~ = fm,ti.,/2 = 1/(26t). From (a) we obtain 6t6f = 1/N, and this gives us the more usual statements for the DFT and its inverse N-l

Y, = 6f

1C, exp (2riknINl k=O

A most common example of the use of statement (b) is t o note that the standard 44-kHz frequency of digital sampling of the audio sound signal amplitude that is recorded on an audio compact disc sets a theoretical limit of 22 kHz for the frequency that can be reproduced. Any attempt to allow of higher frequencies in the sound signal regenerated from the digitized data will lead to spurious effects (aliasinel. and the sienal must be filtered to be certain that this frequency limit is not exceeded or even approached too closely. Sampling and Windowing as Formal Operations

In practice the recording of data representing acontinuing signal is accomplished by turning on the measurement apparatus for afinite period of time, or window, and then making measurements a t regular intervals during this sampling window. This can be represented by a series of multiplication operations, which are easier to depict graphically than to show with proper mathematics. The sampling operation is represented by an infinite train of eauallv . soaced imoulses of uniform heieht and essentiallv zero width. This infinite sampling train is shown in Figure 4a. We will use the result that the Fourier transform of this infinite train of pulses at intervals of At is another infinite train ofpulsesat intervalsof 4f = 1/A1 on the frequency axis,

..

Discrete Fourier Transforms

Although a process may occur in the laboratory as a continuous function of time, it is almost always measured or sampled a t discrete time intervals, and any computation must deal with such a function, y(t) for example, as a set of discrete data points rather than as a continuous function. The Fourier transform is eenerallv also calculated a t an equal number of points, and-this discrete or "sampled" character of the function and of its transform has considerable consequences. Let us assume that N samples are taken of a transient signal y(t) with a time interval of 6t between each sample. The total observation time is then N6t, and frequency of sampling is I/&. The frequency spectrum will then be computed, or sampled, a t some corresponding uniform in130

Journal of Chemical Education

Figure 4. (a) lmpulpetraln,spacing 61. (b) Fourier transform of (a),spacing 61=

1/61

Figwe 5. (a) cos (2nfo11. (b) Sampling window of width TO = 3/(2fQ). (c) Sampling hrnctlon for interval 61. (d) Pradwt showing values for sampled cos function.

as shown in Figure 4b. This statement may be represented using delta function notation as

This representation of the infinite pulse train and the calculation of its Fourier transform require a bit of care for proper mathematical treatment: Fienre 4 contains the essentialsfor our purposes. ~ u l t i p l i c h i &of the continuous y(t) by the sampling train of Figure 4a results in the set of sampled values of y(t) a t times defined by the spacing t of the sampling pulse train, or again using delta function notation The window operation is represented by multiplication by a function that is unity during the observation period, zero outside of this interval. These multiplications of the continuous y(t) by the sampling and windowing functions are indicated graphically in Figure 5 where y(t) for illustration in Figure 5a is taken to be a continuous cos function, and the sampling window in Figure 5b is set t o observe 21' 2 cycles of this cos wave. Figure 5c shows a sampling function and Figure 5d shows the result of the two multiplications. The order of the multiplications does not matter. The final result shown for the set of data points, or y, values, is therefore represented by the product of the three definable functions. We see then that the DFT of the time-sampled pulse, the actual data set at hand,may be considered formally to be the transform of a product of functions as shown in Figure 5. The DFT calculation using eq 11 in turn generates a sampled transform of the y, data set. We know the Fourier transforms of both the sampling window (Fig. 3b) and the sampling train (Fig. 4b). We would like to find the transform . does this relate to the DFT of the sampled data of ~ ( t )How sei? The answer is in the convolution thenrem, which relates the Fourier transform ofaproduct to the Fourier transforms of the individual factors i n the product.

Figure 6. Operatima in convolution lntegrsl

the result of mirroring one of the functions Cy(t') in this case) about an ordinate axis a t t' = t/2 followed by multiplication bv xit'). This is shown in eoine directlv from Fienre 6a to ~;gu;e6h.One also may see this as a mi;roring oi;(tf) about the t' = 0 axis. shown in Fieure 6c followed bv translation of y(-t') by amdunt t t o generate y(t - t') in Piinre 6b. The value of the convolution a t t then is the area under the product curve shown in Figure 6h, and provides the value of the convolution for this t value in Fimre 6d. The operation in repeated for different values of t'to generate Figure 6d, which is then the convolution of the two functions. The result for the example chosen in Figure 6 is a somewhat blurred version of the x(t) curve. The convolution operation corresponds to some common experimental phenomena. The effecul of finite spectrometer slit width and other factors that limit the resolvine Dower of a spectrophotometer may be represented by a win'hbw function of u,idthcomoarable to the resolutionoftheinstrument. The final ohservid spectrum is then the convolution of this window function with the "true" snectrnm of the samnle. Distortion in an optical train may be represented by a twodimensional window function. The distorted imane is then the convolution of this function with the input image. If one knows the form of these window or transfer functions, it may be possible to perform a "deconvolution" to recover the less distorted signal. Figure 7 shows the results of performing the convolution operation with some pairs of functions. Figure 7a shows the convolution of two rectangular forms; the form of the convolution may be conjured by considering the definition of the convolution and/or the geometric operations depicted in Figure 6. Figure 7b shows a most useful result that the convolution of a function with a nuhe train eives the renetition of the function at intervals specified h c h e pulse ;rain. If the extent of the function alone the variable axis is ereater than the spacing between the impulses, then the overlaps

- -

Convolution Theorem We must first define the convolution operation and illustrate i t with some useful examnles before statine the convolution theorem, which provides an answer to the question in the preceding paragraph. The convolution of two functions x(t) and y(t) is defined as

x(t)*y(t)=

;1-

x(tr).y(t - t')dt'

The convolution o~erationusuallv benefits from some attempts a t graphicaiinterpretation:ln Figure 6 we see curves that represent the convolution of two functions as a series of operat~onsusing the dummv variable of integration t'as the independent variable. The integrand may he visualized as

Figure 7. Canvolutlons.

Volume 66 Number 2 February 1989

131

must be added. The example in Figure 7c is included to remindus that the result of Fipure 7h does not d e ~ e n don the left function being a rectanguiar form. Figure 7camightsuggest to us that a one-dimensional crystal can be viewed as the convolution of the one-dimensional electron density function of the unit cell with an impulse train having the spacing of the unit cell length. This impulse train then is a onedimensional lattice function. A three-dimensional crystal could then he expressed as a triple convolution of a unii cell volume with a three-dimensional lattice function. Fieure 7h is worth some additional examination. The convoluiion of the centered pulse of width 7012, shown in Figure 3a, with an impulse train with uniform spacing TO,shown in Figure 4a and Figure 7b, is seen to he identical with the square wave of Figure la. We are now ready to use the two following equivalent statements of the convolution theorem: ~

~~~~

(a) The Fourier transform of a product of functions is the convolutim of the Fourier transforms of each of the functions. (b) The Fourier transform of a convolution of two functions is the product of the transforms of each of the two functions. I t is the utility of these statements that leads us to discuss the convolution operation. If the infinite svmmetrical sauare wave pulse train "f ~ i g u r el b is the convoiution of the s&le pulse of Figure 3a with an impulse train like that of Fieure 4a, then the Fourier transform of the Figure l b is the Product of the Fourier transforms of Figure 3a and of Figure 4b. The convolution theorem tells us that Figure l b must be the product of Figures 3b and 4hl Multiplication of the sinc function shown as the transform in Figure 3b by the lattice in frequency space, Figure 4b, corresponds t o sampling the sinc function a t intervals of f o to find the Fourier series coefficients for the uniformly periodic square wave. Figure 2a represents the convolution of the sinele pulse of Fieure 3a w i t h a more widely spaced pulse train tdan was shiwn in Figure 4a and hence the transform of Figure 3a was "sampled" more often than was the case for the symmetrical square wave with the shorter period. One final connection should he made. It was earlier noted and illustrated with an example in Figure 5 that any lahoratory ohservation of a transient signal generally involved repeated measurements or sampling over a finite time interval or window. Fieure 6 showed this as the oroduct oi the "true" signal, a continuing function of time, dith a sampling pulse train and a rectangular window function. Applications in many areas, e.g., NMR, electrical circuit design, F T infrared spectroscopv, etc., will require a freauencv analvsis of this transient,meaning that a Fourier tr&sform of thldata must be performed. A set of discrete values implies that a discrete Fourier transform (DFT) (or its inverse) must be calculated. The convolution theorem cells us that the Fourier transform of the data set, represented as the final product in Figure 5, will be the product of the Fourier transforms of the individual factors also illustrated in Figure 5. How will the DFT calculated from this data set compare with the ideal Fourier transform obtained as the inteeral of a continuous function? The convolution theorem will iell us. We have the Fourier transforms that are needed to answer this question, and they are assembled in Figure 8. The Fourier transform of the cos (2fot) function is real and is shown in Figure 8a. This would be the Fourier transform of a data set obtained by finely sampline a cos function of the freauencv fo for many cycles. ~ h e i r a i s f o r mof the sampling window, square pulse of width To, is the sinc function of Figure 3b, scaled to appropriate width inFigure 8b. The sampling function showing data collection a t intervals of 6t has as its

transform the pulse train of Figure 8c. Multiplication of functions in the time domain requires (convolution theorem) that the transforms be convolved in the frequency domain, as is shown for the functions in Figures 8a, 8b, and 8c. In the example shown a data set of 64 values was assumed to have been taken over the time range To. The calculation of the DFT thengives a sampling of the transform a t frequency intervals of l/To, asshown by multiplication by the sampling function of Figure Ed. The final result of these operations with the transforms appears in Figure 8e as the result to be expected for the discrete transform of the data set. Figure 8e shows the magnitude of the transform without anv ohase information. lishows peaks at the f'requencies rfoas experted from Figure 8a. It also shows a zero freauencv - -oeak . since the average of a cos function over a noninteger number of cycles is not zero. Figure 8e will also repeat in frequency space because of the sampled form of the DFT which is calculated. We can see that Figure 8e is not sharp. More cycles of the cos function must be sampled to get 'cleaner an exact intefrequency spectrum from the DFT. Sampling - . ger number of complete' cycles would also give the ideal Figure 8a for the transform of a pure cos function.

..

~~~

Conclusion

Parts I1 and 111 will continue with applications of these ideas to NMR and X-ray diffraction as structural methods. Appendlx

The followin relations involving complex numbers are used or for real a, exp (ia) = cos a + i sin a; cos (a) = [exp implied: i = fie) + exp (-ia)]/2; sin (a) = [exp (ia) - exp (-ia)]l(Zi); complex numherz = x + iy = Izl exp (in), wherelzI2= x2 + y2and phase a = tan-' blx).The complex function f(z) = u(ry) + iu(xy), where u and u are real functions,may be similarly represented by f(z) = If(z)l exp (ia), with lf(z)I2 = u2 u2 and phase n = tan-' (ulu). Complex conjugation operation: r* = r - iy; f(z)*= u - iu; (exp (ia))* = exp = f(z) .f(z)*. (-ia);lf(~)1~

d;

+

Acknowledgment

The author is particularly grateful to M. R. Willcott, 111, NMR Imaging, Inc., Houston, TX, for his hospitality during a sabbatic leave in 1985-1986, for his tutelage in matters including NMR imaging theory and practice, and for helpful commentary concerning this paper.

a

132

Journal of Chemical Education

Figure 8. (a) FT of cos (2rfoQ.(b) FTof sampiing window of width To = 5/(2fo). sampling function ol interval 6t. (d) Sampling function for DFT. (e) Magnitude of DFT of sampled cos (2rfof).

( C ) FT Of