Fourier Transforms Simplified: Computing an Infrared Spectrum from

Jan 26, 2012 - Quentin S. Hanley*. School of Science and Technology, Nottingham Trent University, Clifton Lane, Nottingham NG11 8NS, United Kingdom...
0 downloads 0 Views 382KB Size
Laboratory Experiment pubs.acs.org/jchemeduc

Fourier Transforms Simplified: Computing an Infrared Spectrum from an Interferogram Quentin S. Hanley* School of Science and Technology, Nottingham Trent University, Clifton Lane, Nottingham NG11 8NS, United Kingdom S Supporting Information *

ABSTRACT: Fourier transforms are used widely in chemistry and allied sciences. Examples include infrared, nuclear magnetic resonance, and mass spectroscopies. A thorough understanding of Fourier methods assists the understanding of microscopy, X-ray diffraction, and diffraction gratings. The theory of Fourier transforms has been presented in this Journal, but detailed practical exercises are limited. A lab-based experiment is described that begins with the acquisition of an interferogram, provides background and instructions for computing and interpreting transformed data using widely available software, applies the principles of Connes’ advantage and sampling theory to calibrate the spectrum, and finishes with an infrared spectrum. Related treatment of free induction decay data from an NMR spectrometer is provided in Supporting Information.

KEYWORDS: Upper-Division Undergraduate, Analytical Chemistry, Laboratory Instruction, Computer-Based Learning, Hands-On Learning/Manipulatives, Fourier Transform Techniques

F

converts the intensities from mirror position to frequency. In the related techniques of FT-NMR and FT-MS, the transform converts time dependent waveforms to frequencies. In the first case (NMR), the frequencies are interpreted after conversion to chemical shift. In the second case (MS), frequency is related to mass based on knowledge of the magnetic field strength. Common to FTIR, FT-NMR, and FT-MS is a data set, g, consisting of N evenly spaced discrete data samples that are transformed over the data index, n, to obtain a set of Fourier coefficients, G, corresponding to specific frequencies, f:

ourier transforms enter the science of chemistry through the structural and characterization tools of the working chemist: NMR, IR, X-ray crystallography, and mass spectrometry. They also arise in a host of other techniques and related disciplines. A number of educationally oriented articles have appeared in this Journal on the topic of Fourier transforms and FTIR going back over 40 years.1−37 These include extensive discussions of the instrumentation and simulations supported by specialized spreadsheets. Practical Fourier methods supported by computational exercises are rarely taught, and although there are a number of excellent texts on Fourier methods (cf. 38, 39), these tend to be highly mathematical making understanding difficult for the beginning student. Fourier methods are discussed in introductory textbooks in a conceptual way40 with limited computations. This gap may be bridged with available software and requires a level of sophistication similar to that required for linear regression. This exercise provides students an opportunity to collect and process an interferogram from a standard FTIR. The steps consist of loading the data into a spreadsheet, applying the Fourier transform, computing the complex magnitude, presenting the data as a transmission spectrum, and finally, applying the Nyquist limit and Connes’ advantage to calibrate the frequency axis.

N−1

Gf =



gn e2πifn / N

n=0

(1)

DFTs and FFTs

This discrete Fourier transform (DFT) (eq 1) when unoptimized requires a number of operations proportional to N2. Fast Fourier transforms (FFTs) require fewer operationsproportional to N log2 Nresulting in large computational savings.39,41,42 Historically, FFT algorithms were discovered independently multiple times over a period of approximately 150 years with Carl Friedrich Gauss (1805) currently credited with the first description in a work published posthumously in 1866.43,44 The modern use of FFTs began with the work of James Cooley and John Tukey45 with one early application being crystallography.46

A modern FTIR instrument collects IR intensity data at different position settings of a moving mirror. The Fourier transform

Published: January 26, 2012



FOURIER TRANSFORMS

© 2012 American Chemical Society and Division of Chemical Education, Inc.

391

dx.doi.org/10.1021/ed2002253 | J. Chem. Educ. 2012, 89, 391−396

Journal of Chemical Education

Laboratory Experiment

transform will be a table of complex numbers corresponding to different frequencies.48 For example,

The most commonly applied FFTs require the number of data points to be a power of 2. This requirement is a property of a particular class of algorithm and is neither a requirement of all “fast” Fourier transforms nor a requirement of the work described by Cooley and Tukey. More extensive discussions of specific algorithms for performing the transform may be found elsewhere;38,39 however, it is worth noting that FFTs are available for all data lengths (N) including prime numbers and multiple dimensions (such as might be useful for 2D-NMR).47

h(x) = 1 + sin(x) + 0.33 cos(3x) + 0.33 sin(3x) + 0.20 sin(5x) + 0.15 sin(7x) can be expressed as a table of Fourier coefficients (Table 1). Although Table 1 contains only integer frequencies, Fourier Table 1. Fourier Coefficients and Equations

Complex Number Representation of Fourier Coefficients

The Fourier coefficients, Gf, produced by the FT operation, scale a set of sine and cosine terms at different, equally spaced, frequencies, which recreate the original data set when summed. By convention, the Fourier coefficients are usually presented as complex numbers with the real part representing the cosine and the imaginary part the sine. This convention arises from Euler’s relationship (eq 2) that provides a link between the complex exponential (eq 1) and the more familiar sine and cosine functions.

e ix = cos x + i sin x

(2)

A2 + B2

(3)

and

⎡ B⎤ ϕ = tan−1⎢ ⎥ ⎣ A⎦

0 1 2 3 4 5 6 7

1 + 0i 0 + 1i 0 + 0i 0.33 + 0.33i 0+0i 0 + 0.20i 0 + 0i 0 + 0.15i

Fourier coefficients corresponding to the equation, h(x) = 1 + sin(x) + 0.33 cos(3x) + 0.33 sin(3x) + 0.20 sin(5x) + 0.15 sin(7x).

coefficients obtained from laboratory data can represent a wide range of real number values. Discrete Fourier transformation of a data set always produces an integer number of frequencies at evenly spaced intervals. Calibrating and interpreting the frequencies requires an understanding of the data collection procedure of the specific instrument producing the data.

where A and B are the real and imaginary parts of the complex number and i is the square root of −1. Complex numbers may be represented as a magnitude, |C|, and a phase angle, ϕ.

|C | =

Fourier Coefficient (Gf)a

a

Complex numbers, C, have the form

C = A + Bi

Frequency ( f)

(4)

The Nyquist Limit and Aliasing

|C| is also referred to as the modulus or the absolute value. The relationship between |C| and ϕ and A + Bi may be understood graphically (Figure 1). For this exercise, the important parameter

The maximum frequency from a Fourier transformed data set is determined by the interval spacing between the points. The Nyquist limit defines the maximum frequency and coincides with the maximum frequency visible in the Fourier transformed data:

f fNyquist = measurement 2

(5)

For example, an interferogram sampled every 500 nm has a Nyquist limit of 10,000 cm−1 (defined by 1/(2 × 500 nm)). Wavenumbers above that limit “fold” into lower wavenumbers via a process referred to as “aliasing”. Calibration of a spectrum in wavenumber may be done through consideration of the Nyquist limit. Zero Filling

A set of N real data points produces N/2 frequencies. Under these circumstances, resolution is lost due to closely spaced frequencies appearing as a single frequency. This can be mitigated by padding the set of N points with N zeroes to produce a data set with 2N points. Visually, improvement can be seen up to 3N zeroes. Zero filling may improve peak widths in portions of a spectrum and provide better representation of bands lying midway between two frequency points in the nonzero-filled spectrum. Additional details on zero-filling may be found elsewhere,38 including specific discussion of IR.49

Figure 1. Illustration of the complex plane. The plot shows the location of 2 + 6i in complex coordinates. The magnitude of the complex number |C| is given by (22 + 62)1/2 and ϕ by tan−1(6/2). The magnitude is proportional to intensity in an FTIR spectrum.

in the complex number is the magnitude because it is proportional to the intensity of light at the frequency represented by a complex number.



Reconstructing a Waveform from Fourier Coefficients

The real and imaginary parts of a complex number produced by a FT represent the cosine and sine terms at a particular frequency. The complex number C = 5 + 2i represents h(x) = 5 cos(x) + 2 sin(x), or, if preferred, h(x) = |C| cos(x − φ). For a given data set, the coefficients produced by the Fourier

FTIR

The Interferometer and the Laser

FTIR instruments for routine use contain 4 key components: an interferometer, IR source, detector (Figure 2), and a HeNe laser. Light entering the interferometer is directed to a beam 392

dx.doi.org/10.1021/ed2002253 | J. Chem. Educ. 2012, 89, 391−396

Journal of Chemical Education

Laboratory Experiment

Figure 2. Block diagram of a Michelson-type interferometer. The locations O, S, and M refer to the positions of the optical beam splitter, the stationary mirror, and the moving mirror, respectively. When length(OS) = length(OM) (dashed line), the path lengths are equal and all wavelengths undergo constructive interference. Displacement of M by λ/4 changes the δ by λ/2. Note that x = length(OM) − length(OS), and δ = 2[length(OM) − length(OS)].

splitter where it is sent along two paths. The first path goes to a fixed mirror. The second goes to a moving mirror. It then returns to the beam splitter where it is recombined. When the two paths are of equal length, constructive interference occurs for all wavelengths. This condition is sometime referred to as the “center burst”. Moving the mirror a distance, x, causes the path length to change by 2x. The path length change is referred to as the retardation, δ. Constructive interference for a specific wavelength, λ, will occur when the retardation is an integer multiple, n, of the wavelength:

δ = 2x = n λ

where

n = 1, 2, 3, 4,...

Figure 3. Simulated interferogram (A) and the magnitude of its Fourier transform (B). The simulation consists of 9 terms where I0 values = [1, 2, 3, 4, 5, 6, 7, 8, 9] and 2π/λ = [2, 4, 6, 8, 10, 12, 14, 16, 18]. The 9 terms (eq 11) were computed at 256 evenly spaced intervals from −π to π.

(6)

Destructive interference occurs when the retardation is an integer multiple of the wavelength plus a half:

⎛ 1⎞ δ = λ ⎜n + ⎟ ⎝ 2⎠

where

n = 1, 2, 3, 4,...

(7)

As the mirror moves, the intensity, I, measured for a particular wavelength will vary:

⎛ 2πδ ⎞⎤ I ⎡ ⎟ I(δ) = 0 ⎢1 + cos⎜ ⎝ λ ⎠⎥⎦ 2⎣

(8)

A single wavelength directed through the interferometer will produces a series of “fringes” (eq 8) as δ changes. If some number, K, of wavelengths, λ, are present, a sum over the intensities, Is, will produce a simulated interferogram (Figure 3):

Figure 4. Raw interferogram. The full data set has been truncated to show detail near the center burst (δ = 0).

wavelength intervals. Fellgett51 also noted the possibility of using interference methods and a single detector to obtain this advantage. Later analyses52−55 indicated that Fourier methods have a S/N advantage ∼(N/8)1/2 under conditions where the detector’s noise limits the measurement. This latter point explains why FT methods are commonly employed in the IR portion of the spectrum where detectors are comparatively noisy and rare in the UV−vis portion where detectors are nearly perfect.

⎛ 2πδ ⎞⎤ Ik ,0 ⎡ ⎢1 + cos⎜ IT (δ) = ∑ ⎟⎥ λk ⎠⎥⎦ 2 ⎢⎣ ⎝ (9) k=1 All frequencies up to the sampling limit are represented in measurements of intensity as δ changes. The measurements allow the whole IR spectrum to be collected simultaneously with the individual wavelengths being detected as different frequencies within the measured interferogram (Figure 4). The ability to measure all frequencies together is referred to as Fellgett’s or the multiplex advantage.12 While comparing spectrographs and spectrometers,50 Fellgett noted that a spectrograph operating for the same time should have a signal-to-noise (S/N) improvement depending on N1/2, where N is the number of K

The Raw Spectrum

The interferogram (Figure 4) can be imported into a spreadsheet and the Fourier transform computed. This produces a table of complex numbers that can be converted into magnitudes (eq 4) to produce a raw uncalibrated spectrum (Figure 5). A number of 393

dx.doi.org/10.1021/ed2002253 | J. Chem. Educ. 2012, 89, 391−396

Journal of Chemical Education

Laboratory Experiment

the measurements. The maximum frequency in wavenumber is defined by one-half the frequency of acquisition (double the wavelength of the monochromatic reference), as governed by f Nyquist. The Nyquist limit for data collected at 632.8 nm (15,803 cm−1) intervals in an FTIR instrument is 1.265 μm (7901 cm−1) and each point along the wavenumber axis is an equally spaced interval of (2f Nyquist/N). For example, if N = 512, the spacing of points on the wavenumber axis will be 30.87 cm−1. Presenting the Finished Spectrum

Presentation of the results is complete (Figure 6) after conversion of magnitude data to percent transmittance (%T) from the reference (I0) and sample (I) data.

Figure 5. Raw magnitude spectrum obtained from the source background. The symmetry about the Nyquist limit is characteristic of fast Fourier transformation of a real data set. This symmetry is sometimes referred to as “half complex” because only half the numbers need to be stored.42 The shaded regions indicate portions of the spectrum where low source intensity results in noisy transmittance values. To calibrate the axis, use the relationship (2fNyquist/N) (see text for details) with N = 4096. Note: the distribution from an ATR cell is very different.

%T = 100%

I I0

(12)

features are worth noting.1 The broad distribution is produced by the source. The IR source produces an approximation to “black body” radiation. Planck’s radiation law describes the spectral energy density, Ub, of a black body source at a particular frequency, ν, and temperature, T:56

U b(ν) =

8πhν 3 c

3

1 hν ekT

(10) −1 where c, h, and k are the speed of light, Planck’s constant, and Boltzmann’s constant, respectively. Given a temperature, the maximum can be estimated using Wien’s displacement law:2,57

vmax ̃ = 1.97(cm−1 K −1)T

Figure 6. Student data from a sample of 3.0 mil polystyrene. The spectrum has been restricted to 500−4000 cm−1 to avoid noise from the shaded regions of Figure 5.



(11)

The spectrum was collected without a nitrogen purge resulting in very strong absorbance by atmospheric water and carbon dioxide.3 The measured intensity is low in portions of the spectrum (Figure 5, shaded regions), particularly below 400 cm−1 and above 6800 cm−1. This is from non-ideal source behavior, optical materials (particularly below 450 cm−1), and intentional filtering at high frequencies to avoid aliasing.

EXPERIMENT

Procedure

Students are given instructions to set up the FTIR instrument to collect an interferogram and save the resulting data in an ASCII format that can be imported into a standard spreadsheet. They transfer the data to a memory device for later work at home. They are encouraged to bring samples of interest; however, samples are available for them in the lab. For this exercise, they collect a background data set with no sample present, a polystyrene reference material, and a sample of their choice. They are instructed to process the data through to completed FTIR spectrum to obtain uncalibrated FTIR spectra of the samples. They then convert raw frequency to wavenumber to produce a calibrated spectrum using their understanding of the Nyquist limit, verify that the calibration is correct against the known spectrum of polystyrene, and assign characteristic bands arising from functional groups within the spectrum of the background and sample.

The Nyquist Limit, Connes’ Advantage, and Wavenumber Calibration

A typical commercial FTIR has a HeNe laser emitting 632.8 nm light. This light is visible to the eye and often mistaken for the IR source. The laser light travels through the interferometer along a slightly different optical path than the IR source and is detected separately. The laser produces an interferometric signal used to trigger data acquisition at evenly spaced intervals. Often, but not universally, the FTIR triggers acquisition of an intensity measurement once per interference fringe. This provides an inherent calibration to the resulting spectrum. Using a monochromatic reference interferogram to calibrate a Fourier transformed spectrum was first described by Janine Connes 58 and has come to be known as Connes’ advantage.5,12,59 For a data set consisting of N measurements of the interferogram, Connes’ advantage can be realized by understanding the relationship between the maximum frequency in the raw Fourier transformed data and the distance spacing of

Data Analysis

Data analysis was done with the assistance of the “Analysis Toolpak” add-in available with MS Excel. Equipment and Materials

The data were collected on a Thermo-Nicolet Nexus 670 FTIR instrument or a PerkinElmer Spectrum 100 equipped with an ATR cell. 394

dx.doi.org/10.1021/ed2002253 | J. Chem. Educ. 2012, 89, 391−396

Journal of Chemical Education

■ ■

Laboratory Experiment

(7) Blunt, J. W. J. Chem. Educ. 1983, 60, 97. (8) Rabenstein, D. L. J. Chem. Educ. 1984, 61, 909. (9) Macomber, R. S. J. Chem. Educ. 1985, 62, 213. (10) Perkins, W. D. J. Chem. Educ. 1986, 63, A5. (11) Perkins, W. D. J. Chem. Educ. 1987, 64, A296. (12) Perkins, W. D. J. Chem. Educ. 1987, 64, A269. (13) Glasser, L. J. Chem. Educ. 1987, 64, A306. (14) Glasser, L. J. Chem. Educ. 1987, 64, A260. (15) Glasser, L. J. Chem. Educ. 1987, 64, A228. (16) Chesick, J. P. J. Chem. Educ. 1989, 66, 413. (17) Chesick, J. P. J. Chem. Educ. 1989, 66, 283. (18) Chesick, J. P. J. Chem. Educ. 1989, 66, 128. (19) King, R. W.; Williams, K. R. J. Chem. Educ. 1989, 66, A243. (20) King, R. W.; Williams, K. R. J. Chem. Educ. 1989, 66, A213. (21) King, R. W.; Williams, K. R. J. Chem. Educ. 1990, 67, A100. (22) Williams, K. R.; King, R. W. J. Chem. Educ. 1990, 67, A125. (23) Williams, K. R.; King, R. W. J. Chem. Educ. 1990, 67, A93. (24) Estler, R. C. J. Chem. Educ. 1991, 68, A220. (25) Foley, J. A. J. Chem. Educ. 1991, 68, 889. (26) Bell, H. M. J. Chem. Educ. 1993, 70, 996. (27) Fuson, M. M. J. Chem. Educ. 1994, 71, 126. (28) Graff, D. K. J. Chem. Educ. 1995, 72, 304. (29) Grunwald, E.; Herzog, J.; Steel, C. J. Chem. Educ. 1995, 72, 210. (30) Bettis, C.; Lyons, E. J.; Brooks, D. W. J. Chem. Educ. 1996, 73, 839. (31) Doscotch, M. A.; Evans, J. F.; Munson, E. J. J. Chem. Educ. 1998, 75, 1008. (32) Sesi, N. N.; Borer, M. W.; Starn, T. K.; Hieftje, G. M. J. Chem. Educ. 1998, 75, 788. (33) Clegg, W. J. Chem. Educ. 2004, 81, 908. (34) Besalu, E. J. Chem. Educ. 2006, 83, 1795. (35) Zielinski, T. J. J. Chem. Educ. 2008, 85, 1708. (36) Overway, K. J. Chem. Educ. 2008, 85, 1151. (37) Hoffmann, M. M. J. Chem. Educ. 2009, 86, 399. (38) Marshall, A.; Verdun, F. Fourier Transforms in NMR, Optical, and Mass Spectrometry: A User’s Handbook; Elsevier: Amsterdam , New York, 1990. (39) Press, W. H.; Teukolsky, S. A.; Vetterling, W. T.; Flannery, B. P. Numerical Recipes in C: The Art of Scientific Computing, 2nd ed.; Cambridge University Press: Cambridge, 1992. (40) Harris, D. Quantitative Chemical Analysis, 7th ed.; W.H. Freeman and Co.: New York, 2007. (41) Embree, P. M.; Kimble, B. C Language Algorithms for Digital Signal Processing; Prentice Hall: Englewood Clifs, NJ, 1991. (42) Galassi, M.; Davies, J.; Theiler, J.; Gough, B.; Jungman, G.; Alken, P.; Booth, M.; Rossi, F. GNU Scientific Library Reference Manual, 3rd (v1.12) ed.; Network Theory Limited: Boston, MA, 2009. (43) Heideman, M. T.; Johnson, D. H.; Burrus, C. S. Archive for History of Exact Sciences 1985, 34, 265. (44) Briggs, W. L.; Henson, V. E. The DFT: An Owner’s Manual for the Discrete Fourier Transform; Society for Industrial Mathematics: Philadelphia, PA, 1987. (45) Cooley, J.; Tukey, J. Math. Comput. 1965, 19, 297. (46) Rockmore, D. N. Comput. Sci. Eng. 2000, 2, 60. (47) Frigo, M.; Johnson, S. G. Proc. IEEE 2005, 3, 216. (48) Sometimes, the output of a real FFT consists of paired numbers not explicitly including i. For details, see refs 39, 42. (49) Herres, W.; J., G. Comput. Appl. Lab. 1984, 5, 352. (50) Fellgett considered spectrographs to be instruments measuring the elements of a spectrum simultaneously and spectrometers to be instruments that measure the spectrum an element at a time. (51) Fellgett, P. J. Phys. Radium 1958, 19, 157. (52) Tai, M. H.; Harwit, M. Appl. Opt. 1976, 15, 2664. (53) Treffers, R. R. Appl. Opt. 1977, 16, 3103. (54) Harwit, M.; Sloane, N. J. A. Hadamard Transform Optics, 1st ed.; Academic Press: New York, 1979. (55) Carli, B.; Natale, V. Appl. Opt. 1979, 18, 3954. (56) Ingle, J. D.; Crouch, S. R. Spectrochemical Analysis; Prentice Hall: Englewood Cliffs, NJ, 1988.

HAZARDS There are no hazards. RESULTS AND DISCUSSION Students have universally been able to complete the Fourier transform of the interferogram. Results (Figure 6) show good correspondence with known compounds and good wavenumber calibration. No systematic discrepancies have been noted.



CONCLUSION Fourier processing is easily done with readily available software. Good FTIR instrumentation is available nearly universally in chemistry teaching laboratories. Over a decade of use, all students have been able to do the Fourier transformation and convert the complex numbers to intensity values. This includes those with the weakest mathematical backgrounds. A minority of students have had difficulty calibrating the wavenumber axis using the Nyquist limit. Students struggle most with basic concepts and skills, such as confusion about I, I0, T, %T, and absorbance, assigning bands to functional groups in spectra, and testing the reasonableness of their results by comparison with known values. The experiment reinforces these concepts while introducing practical Fourier methods, sampling criteria, the use of complex numbers to represent sine and cosine terms, and Connes’ advantage. The exercise provides an accessible introduction to practical Fourier transforms in chemistry. The data processing portion may be used on its own to demystify an intimidating concept or as a supplement to the wide range of existing highly mathematical treatments. Similar processing can be applied to the raw NMR free induction decay (FID) and a sample data set is included in the Supporting Information.



ASSOCIATED CONTENT

S Supporting Information *

Instructions for students; instructor’s notes; discussion questions and outline answers are available to assist those wishing to adopt this as a laboratory exercise; a practice data set consisting of reference and sample interferograms is available in Excel format; for those wishing to apply Fourier processing in another context, an NMR data set and analysis guidance notes have been provided. This material is available via the Internet at http://pubs.acs.org.



AUTHOR INFORMATION

Corresponding Author

*E-mail: [email protected].



ACKNOWLEDGMENTS The author thanks the many students at Nottingham Trent University and the University of the West Indies Cave Hill Campus who did versions of this exercise between 2002 and the present. He thanks Dr. Jon Tepper and CELS for encouragement and Dr. Chris Garner for providing the NMR FID data set.



(1) (2) (3) (4) (5) (6)

REFERENCES Low, M. J. D. J. Chem. Educ. 1970, 47, A415. Low, M. J. D. J. Chem. Educ. 1970, 47, A255. Low, M. J. D. J. Chem. Educ. 1970, 47, A163. Pearson, J. E. J. Chem. Educ. 1973, 50, 243. Marshall, A. G.; Comisarow, M. B. J. Chem. Educ. 1975, 52, 638. Strong, F. C. J. Chem. Educ. 1979, 56, 681. 395

dx.doi.org/10.1021/ed2002253 | J. Chem. Educ. 2012, 89, 391−396

Journal of Chemical Education

Laboratory Experiment

(57) The wavelength dependent versions of both Planck’s radiation law and Wien’s displacement law are more commonly presented in textbooks and monographs. It is worth noting that the maximum in equally spaced frequency intervals is not equivalent to the wavelength dependent version. (58) Connes, J. Rev. Opt. Theor. Exp. 1961, 40, 41. (59) Connes’ original work used glass optics and was calibrated with a red Cd lamp.

396

dx.doi.org/10.1021/ed2002253 | J. Chem. Educ. 2012, 89, 391−396