Fourier transforms (FT) are universal in chemistry, physics, and biology. Despite FTs being a core component of multiple experimental techniques, undergraduate courses typically approach FTs from a mathematical perspective, leaving students with a lack of intuition on how an FT works. Here, I introduce interactive teaching tools for upper-level undergraduate courses and describe a practical lesson plan for FTs. The materials include a computer program to capture video from a webcam and display the original images side-by-side with the corresponding plot in the Fourier domain. Several patterns are included to be printed on paper and held up to the webcam as input. During the lesson, students are asked to predict the features observed in the FT and then place the patterns in front of the webcam to test their predictions. This interactive approach enables students with limited mathematical skills to achieve a certain level of intuition for how FTs translate patterns from real space into the corresponding Fourier space.
Fourier Transforms (FTs) are an essential mathematical tool for numerous experimental and theoretical methods. Biophysical characterization techniques, including nuclear magnetic resonance (NMR) spectroscopy (1), infrared spectroscopy (2), x-ray crystallography (3), mass spectrometry (4), and differential scanning calorimetry, rely on FTs for data processing or analysis (5). Spatial reconstruction algorithms based on FTs are at the core of modern biomedical imaging applications, such as magnetic resonance imaging (6). Modern molecular dynamics simulation packages implement fast FT algorithms to improve computational accuracy and efficiency (7). Although certain experimental methods, such as infrared spectroscopy, are nearly universal in undergraduate teaching laboratories, FTs are automatically carried out by internal software libraries with preprogrammed settings that are typically hidden from the user (8). Developing an intuitive understanding of FTs is therefore essential for undergraduate students to fully grasp the principles behind these techniques. Although there are many excellent articles and textbooks on Fourier methods, pedagogical approaches can be highly mathematical (9–11), introduced within the context of specific techniques (12), or be brief and oversimplified (13). Thus, it is challenging for students not equipped with strong mathematical skills to understand what a FT does and, more so, to acquire intuition for how a FT translates one function into its conjugate function in the Fourier domain.
Modern pedagogical approaches are designed to develop competency across the entire cognitive spectrum: Remembering, Understanding, Applying, Analyzing, Evaluating, and Creating (14). Classroom activities are needed that provide students hands-on experience utilizing Fourier techniques. Students should gain a conceptual understanding of how patterns in one domain are translated into its conjugate domain, as well as more practical knowledge, such as intuitively predicting the effect of a Fourier filter. Specifically, it is important for instructors to address advanced learning goals by providing opportunities for students to generate, analyze, and evaluate predictions. Here, I present an interactive lesson plan that uses computer software to enable students to predict two-dimensional (2D) FTs of various patterns and test their predictions in real time. Figure 1 shows an example of the reciprocal relationship between real and Fourier space, where a periodic grid pattern is translated into a series of peaks. The spacing between Fourier peaks is inversely proportional to the spacing between lines in real space.
II. SCIENTIFIC AND PEDAGOGICAL BACKGROUND
Fourier transforms are typically introduced in upper-division undergraduate or graduate courses. The typical lecture begins with the concept of the Fourier series (9). Within this approach, a function in one domain, for example a function in space (x), is described as a linear combination of functions in a conjugate domain, such as reciprocal space q:
where Ak and Bk are the Fourier coefficients, which are interpreted as the amplitude of a component with a given periodicity qk. This mathematical transformation is analogous to a change of basis, where the original function is decomposed into coefficients in reciprocal space, much like a change of coordinate systems in Euclidean space. In this analogy, the Fourier coefficients represent the projections of the original function onto the basis of sine or cosine coordinates. In general, no information is lost in converting between domains because, given an FT, the original function can be recovered by performing the corresponding inverse transformation. Mathematically, the FT may be introduced as a limit of the Fourier series:
Extending Fourier methods to multiple dimensions is seldom introduced in undergraduate courses, despite multidimensional transforms being essential in techniques such as molecular dynamics simulations (7), x-ray crystallography (15), or NMR spectroscopy (16, 17). Therefore, it is important to expose students to multidimensional FT methods alongside these techniques. Consider a function in the x–y plane; the 2D FT of this function may be interpreted as a one-dimensional FT along the x dimension followed by a second FT along the y dimension, and the result is invariant with respect to the order of operation.
Formally, a 2D FT can be written as a double integral:
where x and y represent real space and qx, qy are the corresponding coordinates in Fourier space. Although F(qx, qy) is a complex function, its modulus or modulus squared is often displayed for ease of visualization. Furthermore, while the definition above is an integral over all space, numerical algorithms involve sums over discrete data points, analogous to the Fourier series concept introduced above (Eq. 1). The fast Fourier transform algorithm is arguably the most ubiquitous implementation because of its computational efficiency (8). Numerical FTs are subject to sampling criteria, such as the Nyquist limit, but these concepts are typically outside the scope of introductory courses (18, 19). The software package described here allows for introducing multidimensional FTs, together with Fourier filters, as well as more advanced concepts and numerical considerations, such as aliasing (9).
III. MATERIALS AND METHODS
A. Software description
The software presented here is written in the MATLAB R2019a (The MathWorks, Natick, MA) programming language. Source code, documentation, and precompiled standalone executables for Microsoft Windows and macOS operating systems are available on GitHub [see (20) for software URL]. Figure 2 shows a screenshot of the main user interface. The interface displays an image in real time (Fig 2B), along with its Fourier transform (Fig 2D). The user control enables adjusting the number of frames displayed per second, the FT horizontal and vertical axis scales, and the colormap scale.
Spectral filtering functions can be applied in the Fourier domain, with the results shown in the reconstructed image. Two filter types are available: (a) a boxcar filter, represented by a circle centered at the origin in the Fourier plane, and (b) a Gaussian filter, represented by a two-dimensional Gaussian function in the Fourier plane (Fig 2E). These two functions can be applied as low- or high-pass filters. The reconstructed image (Fig 2C) shows the effect of the filter. It is important to note that the displayed Fourier image represents the absolute value, or modulus, of the otherwise complex Fourier plane, but the full complex FT representation is used to reconstruct the real-space function. Therefore, the software cannot be used to illustrate phase effects in the Fourier domain, an important consideration for techniques such as x-ray diffraction crystallography (21).
In this example, the input pattern is a random distribution of vertically elongated oval shapes (Pattern S7). Horizontally elongated rings are observed in the Fourier domain (Fig 2D). These rings are directly related to the size and shape of the ovals. The image illustrates how FTs can extract information related to the molecular shape despite random positions of molecules in real space. For example, the well-known diffraction photograph of partially aligned nucleic acid fibers recorded by Franklin and Gosling (22) showed several diffraction spots arranged in an “X” pattern oriented along the vertical axis, together with oval-shaped diffraction rings. The pattern shows evidence of a helical conformation despite the random translation and partial orientation of the DNA strands (22). The recorded pattern was later analyzed and the double-helix structure of B-DNA was proposed (23).
The Supplemental Material includes a set of patterns that can be printed on paper and used as inputs to the FT program in the lesson described below. This program bridges the gap between physical and digital domains by providing a physical input in the form of a pattern on paper that becomes digitized. This tool complements a traditional lecture by providing a platform for instructors to address advanced educational goals (14).
B. Lesson plan
The lesson presented here has a primary learning objective: students will intuitively understand the reciprocal relationship between real and Fourier space and how periodicity is translated across domains. This lesson should be preceded by a mathematical introduction to FTs, following the typical approach of upper-level undergraduate textbooks, as outlined in the Introduction (9, 11). The instructor begins the lesson by demonstrating a selection of example patterns, such as the patterns shown in Figure 1. The instructor should describe each pattern in real space and explain the origin of the features observed in the corresponding Fourier space. Certain patterns have direct analogies to specific experiments or experimental techniques, and the instructor may use this part of the lesson to describe analogies to FT applications in biophysics. For example, the helical pattern in Figure 3 produces an “X” that resembles the historic DNA x-ray diffraction pattern first recorded by Franklin and Gosling (22, 24). Pattern S14 contains a distribution of partially aligned helices, with random tilt angles. The Fourier transform of this image produces an X-shaped pattern with specific peaks displaying lower intensity. Namely, counting outward from the center of the diffraction pattern and labeling the center as the first peak, the fourth peaks in the “X” are suppressed compared with the others. The suppressed peaks are a well-known characteristic of the diffraction pattern of DNA (25).
During this part of the lesson, the instructor should emphasize the following concepts: (a) Real and reciprocal spaces are inversely related. The instruction can demonstrate this relationship in several ways; for example, moving the paper closer to the webcam zooms in on the pattern, effectively increasing the period and causing the FT features to move closer to the center of the FT plot. Several patterns with different periodicities are provided in the Supplemental Material. (b) Periodicity appears as discrete peaks in the Fourier domain. Together, these examples help students develop a conceptual foundation for interpreting Fourier transforms in two dimensions. Specific patterns, such as the pair shown in Figure 1, are provided with the dual purpose of illustrating how periodicity in real space is translated into discrete peaks, as well as showing how decreasing the period in real space generates peaks spaced farther apart in reciprocal space. (c) The built-in high- and low-pass filters can be applied to display how different frequency components are represented in the reconstructed image. The instructor can select specific cutoff frequencies and toggle high- and low-pass filters to demonstrate how images can be represented as a sum of low-frequency (smooth) components along with certain high-frequency (sharp) components. The software enables the user to apply filters in either horizonal, vertical, or both dimensions simultaneously. The duration of this first introduction to FTs should typically occupy 15–20 min of the lecture period.
During the second half of the tutorial, the instructor hands out a different pattern to each student. Students spend a few minutes studying their assigned patterns and are then asked to predict the expected features in the Fourier domain. Each student then brings the assigned pattern to the front of the classroom, shows it to the class, and predicts the Fourier features. The class is asked whether they agree or disagree with the student's interpretation. When students are not in agreement, a short discussion should follow. Although the purpose of this exercise is to enable students to apply their knowledge, asking each student to announce a prediction to the entire class provides a valuable opportunity to engage all students, including students who are otherwise timid or reluctant to participate. The instructor should refrain from validating or discrediting a student's predictions. The student is then asked to hold the assigned pattern up to the webcam to reveal the Fourier features. After the experiment, the student is asked to reevaluate the prediction. If the prediction was correct, the concept is further reinforced; if the prediction was incorrect, the instructor may take the opportunity to clarify key misconceptions. For instance, a common misconception is that students fail to predict the inverse relationship between real and reciprocal space. Once the students have observed the patterns, the instructor may also use the opportunity to describe the analogies of certain patterns to the class, such as the DNA helix analog shown in Figure 3.
Finally, as a mastery component of the lesson, students can be given blank sheets of paper and asked to create a new pattern and predict the FT features. During this portion of the lecture, students are encouraged to work in small groups, where they can discuss the concepts and create the patterns that give rise to interesting FT features. Students can make simple modifications to the existing cards, such as drawing one pattern over another or drawing entirely unique patterns. Because FTs are linear transformations when two patterns are superimposed in real space, in general, an overlay of the two individual FT patterns is observed in reciprocal space. Note that the modulus of the complex FT function is displayed in the program for ease of visualization; artifacts may therefore be present as a result of not displaying the real and imaginary components separately.
The entire lesson should last approximately one class period, about 45 min. The described lesson is ideal for a class size of 10–15 students. In larger classes, students may work together in groups of two or more. This pedagogical tool addresses learning outcomes across all levels of the cognitive spectrum—Remembering, Understanding, Applying, Analyzing, Evaluating, and Creating—ensuring that students achieve full competency in this topic.
Mastery of the material can be tested in exams or homework by designing exercises that require students to match a real-space pattern with the corresponding Fourier pattern or to predict the effect of a Fourier filter in the reconstructed image. For example, a student may be given an image with a superimposed periodic pattern and asked to explain how FTs can be used to suppress the pattern and recover the original image. Students are asked to explain their thought processes for a more in-depth evaluation of their conceptual understanding.
The lesson plan described here has been implemented in the curriculum of two courses at the University of Texas at Austin, an upper-level undergraduate course in Biophysics, and a graduate-level course in time-dependent quantum mechanics and spectroscopy. Students have been responsive to the lesson, and together with a traditional lecture on FTs, this interactive activity has been successful for communicating the concept of FTs beyond the traditional mathematical approach that is commonly used. The activity is compatible with student-centered pedagogical approaches such as flipped classroom environments. In addition to the material covered, group work, advanced hands-on predictions, and teamwork are important elements of the lesson that are difficult to address using a more traditional approach.
I have presented an interactive lesson plan developed around a real-time FT program to develop competency and intuition among upper-level undergraduate and graduate students. The lesson illustrates the use of consumer technology to perform experiments in the classroom and bridge the gap between the digital and physical worlds. Instructors may adopt the lesson across different courses in the physical sciences. Previous experience shows that students are not only responsive to this approach but find the lesson instructive and enjoyable.
Supplemental input patterns for Materials and Methods are available at: https://doi.org/10.35459/tbp.2019.000102.
The author acknowledges Prof. Kevin Kubarych (University of Michigan, Ann Arbor) for the original idea for the program. Jennifer C. Flanagan (University of Texas at Austin) compiled and tested the software for the macOS platform. The work has been generously supported by the Welch Foundation (F-1891) and by the National Science Foundation through grants BIO-1815354 and CHE-1847199. I thank the students at the University of Texas at Austin for useful feedback on the software and lesson plan.
CRB designed and implemented the lesson plan, wrote the software, designed the patterns, and wrote the manuscript.