A Didactic and Visual Approach to the Fourier Transform

This work provides a comprehensive derivation of the Fourier transform, with less emphasis on the mathematical rigor associated with the theory. Instead, its primary goal is to serve as a didactic resource that fosters an understanding of various abstract concepts through straightforward, visual, and animated examples. This approach aims to make the study more accessible to those approaching the subject for the first time.


Introduction
When the French mathematician Jean Baptiste Joseph Fourier in 1822 began to study the phenomenon of heat conduction in solid materials [1], he found a way to analyze functions with a high level of complexity, by expressing them through a series of sinusoidal functions, because the latter are much easier to study, this process is called a Fourier series [2].Based on the previous idea, the Fourier series of a periodic function could be analyzed when its period tends to be much larger than the width of the interval that characterizes the function.Although it is counter-intuitive, the function would no longer be periodic, but we obtain an information related to the frequencies of the sinusoidal functions that characterize it.That allows to get another description of the same function, being essential its characterization, this is called the Fourier transform of the function.
Currently, there are some examples of applications of Fourier transform in areas such as: light diffraction [3]; in the analysis of electronic signals in the theory of communications [4]; in techniques for solving differential equations with boundary conditions [5]; processing images [6], and images obtained by nuclear magnetic resonance [7] or computed tomography [8]; in the description of natural phenomena on an atomic scale through quantum mechanics [9]; in quantum computing using quantum fourier transform algorithms [10] and quantum phase estimation [11]; in machine learning in the extraction, processing and compression of data [12].
In relation to the aforementioned, the present document is organized as follows, in section 2 the notion of periodic function and its description through the * Correspondence email address: david.velasco.v@gmail.comFourier series is introduced.In section 3 an alternative and abbreviated description of the Fourier series using complex functions is shown.Section 4 deals with simple theoretical deduction, without mathematical rigor, to understand the main concepts and essence related to the Fourier transform through visual examples and animation videos, and finally in section 5 an explanation of the properties of the Fourier transform is presented.

Fourier Series
The analysis starts with the definition of a onedimensional real function f (t) that exhibits a repetitive behavior after a certain displacement of its argument, t → t+T , for any value t, If a function that satisfies the previous condition is called a periodic function, where T is the period of the function.
In the graphical representation of a periodic function, the same behavior is observed at regular intervals, for example in Fig. 1 we evident that the characteristics of the function are the same after a period in its representation.
The simplest examples of periodic functions are the trigonometric functions sine and cosine, as well as the constant function satisfying the condition (1).In this way, J. Fourier developed a way to represent any periodic function through a linear combination of sines and cosines of different angular frequencies, where ω 0 = 2π/T is the angular frequency that characterizes the periodic function f , whose expansion coefficients ( Through the knowledge of the coefficients, any periodic function can be expressed as a sum of even (cosine) and odd (sine) functions, constituting a basis of linearly independent functions.To understand the linear independence of trigonometric functions, it is necessary to analyze the following conditions: For any distinct integers m and n (m ̸ = n), the integrations will always be zero, implying the orthogonality of the functions.However, when m = n, the first two integrations are equivalent to T /2 1 , which means that the sine and cosine functions are not normalized.Therefore, in the definition of the coefficients of the series expansion, they are expressed as the reciprocal of the previous result, related to the projection of the periodic function f onto each of the trigonometric functions that make up the infinite and orthonormal basis of the expansion.Thus, any periodic function can be represented as a sum of sines and cosines if the integrals (3) exist and the coefficients converge to express the Fourier series of the function.On the other hand, the 1 We recommend that the reader demonstrate the particular value of integration using the trigonometric identities cos(x ± y) = cos x cos y ∓ sin x sin y, and sin(x ± y) = sin x cos y ± cos x sin y.Furthermore, the limiting case of lim x→0 third integration is always zero because the integration interval is symmetric, but the integrand is a product of functions with odd parity.Alternatively, the Fourier series can be expressed in a compact form by using the Euler identity e ix = cos x + i sin x, where i denotes the imaginary unit (i2 = −1).Then, the Fourier series is re-expressed using the complex exponential e inω0t instead of writing the sine and cosine functions separately.To understand the reason for this simplification, it will be detailed in the following section.

Complex Fourier Series
Considering any periodic function f (t) of period T , expressed by the sum of the trigonometry functions (2), and bearing in mind that cos x = 1  2 (e ix + e −ix ) and sin x = 1 2i (e ix −e −ix ), we rewrite the series as, (5) obtaining a series whose coefficients are complex, Where the third term of the series is equivalent to performing the sum from minus infinity to n = −1.Thus, we abbreviate the sum to, In this way, the last representation is known as the complex Fourier series, whose coefficients 2 are given by, When n = 0 the coefficient c 0 represents the average value of the periodic function.In order to exemplify the complex Fourier series, three examples of simple periodic functions will be discussed below.

Example 1
Calculation of the coefficients c n of the function f (t) = A cos(ω 0 t), associated with the complex Fourier series, where A is a constant.The process begins by identifying the period T 0 = 2π/ω 0 , and expanding the complex The first integral is equivalent to T 0 /2 when n = ±1.
The second integral will always be zero because the integrand is an odd function and the integration interval is symmetric.In this way, we obtain the two coefficients of the cosine function in the expansion of the Fourier series, This implies that the cosine function is expressed by two positive real coefficients respectively associated with the angular frequency of the oscillation ω 0 , In Fig. 2 both expansion coefficients are represented in a spectrum of amplitudes, revealing that only two coefficients equivalent to half the amplitude of the cosine function and angular frequencies ω 0 are needed to express it.
Example 2 Similar to the previous example, calculate the coefficients c n of the complexed Fourier series for the function f (t) = A sin(ω 0 t), where A a constant and the period T 0 = 2π/ω 0 .Expanding the complex exponential, Following the same reasoning described in example 1 for the integrations, we obtain the two coefficients of the complex Fourier series, This means that the sine function is expressed using two complex coefficients of opposite signs related to the odd parity of the function, In Fig. 3 we can observe the complex coefficients related to the angular frequency ω 0 , contrary to the cosine function whose coefficients are real positive.

Example 3
In this case, a periodic function of abrupt changes will be considered, called as rectangular wave of period T , shown in Fig. 4, defined as: whose angular frequency is ω 0 = 2π/T .In this situation the coefficients of the complex Fourier series after some algebraic processes are expressed as,   where ω 0 b/2 = πb/T , We observe that the coefficients associated with the rectangular wave are real, this is because the function has an even parity.Additionally, zero coefficients occurs every time nb/T represents an integer value (except when n = 0).In order to facilitate the understanding of the previous result, we present in Fig. 5 the coefficients of the rectangular wave for different values of the ratio b/T , and for a better appreciation of ratio's variation b/T we recommend to watch the video by clicking here [13].
Once we know of the complex coefficients of the rectangular wave function (17), the reconstruction of the function by expanding the series will be proved below, Since the coefficients of the expansion satisfy the property c −n = c n , we rewrite the expansion as: In Fig. 6 the reconstruction of the rectangular wave can be seen considering the particular case of a sum limited to a finite number of terms n.As the amount of coefficients to be assumed increases, the expansion resembles the function itself.For a better visualization of the reconstruction of the periodic rectangular function, we recommend to watch the video by clicking here [14].

The Fourier Transform
In order to develop the next reasoning, the rectangular function will be assumed (15) to facilitate its understanding.In this way, it is considered that the period of the function is extremely greater than its rectangular width T ≫ b, thus it can be considered infinite (T → ∞).
Consequently the terms (17) will tend to, lim So, the coefficients will have very small values, and it will be associated with very close angular frequencies nω 0 due to the very large period of the function.Allowing to obtain a continuous spectrum of amplitudes for the rectangular function of "infinite" period.A brief way of showing it without all the mathematical rigor will be presented by denoting the period of the function in relation to the angular frequency in the Eqs.( 7) and ( 8), and changing the variable of integration t → x, when T → ∞, the angular frequency of the periodic function goes to zero ω 0 → 0. By defining the angular frequency of the function through a very small variation ω 0 = ∆ω, the angular frequency of each of the harmonics in the expansion will tend to a finite value, but an infinite number will be required of them, this implies that, Certainly the function would no longer be periodic, that let us to define the infinitesimal variation of the angular frequency (∆ω → dω), Thus, the sum of all harmonic components in the series will be equivalent to a Riemann sum when n → ∞, The internal integration is defined, as the Fourier transform of the non-periodic f (t) function, also known as the continuous frequency spectrum.
For a better understanding of the previous process, we show in Fig. 7 the frequency spectrum for the short and long period rectangular wave.We recommend to watch the video of the spectrum of the rectangular function when it is transformed from discrete to continuous, clicking here [15], also in the explanation of the next example.

Example 4
Calculation of the Fourier transform of the rectangular function, defining it using the constants a and b as, We define H(ω) as the Fourier transform of the rectangular function, easily determined by considering the interval − b/2, b/2 in which the function has a nonnull value, We notice that this result is similar to the frequency spectrum ( 16) of the rectangular wave.However, it is observed that the composition of the rectangular function will require a continuous and damped spectrum of frequencies because of its discontinuity and non-differentiable, making it necessary high frequencies associated with the abrupt transition from the null value to the value a, and vice versa.Furthermore, it is worth pointing out that for the particular case in which the function f (t) is defined in the space of the time variable t, its Fourier transformed function will be defined in the space of the reciprocal variable, that is, the angular frequency ω is expressed in units of radians per unit of time.
On the other hand, once we know the Fourier transform of a function F (ω) (i.e. its spectral information), it will be possible to represent function f (t) by defining the inverse Fourier transform, Considering the Eqs.( 25) and (28), we note that f (t) and F (ω) constitute a pair of univocal relation, implying that the one temporal function f (t) will only correspond to a single representation of function F (ω) in frequency space, and vice versa.This will be valid whenever the function f (t) satisfies the condition, to be able to calculate its Fourier transform and express it through a non-infinite spectrum of frequencies.This condition is known as Parseval's Theorem [16], which will not be proved, Once the concept of the Fourier transform is clear, some of its most relevant properties are presented below.
Therefore, the Fourier transform of a linear combination between functions will be equivalent to the linear combination between the transforms of the respective functions.

Dilation or contraction
Given the function f (at), the function can expand or contract, if the positive constant a is less than or greater than one, respectively.Defining F (ω) = F[f (t)] as the Fourier transform of the function, Making a change of variables, x = at, dx = a dt, This result indicates that if the function's argument is multiplied by a constant, the function's transform will be multiplied by the reciprocal of that constant.We present in Fig. 8 an example of Fourier transform dilation or contraction of a cosine function of finite duration.Additionally, we recommend to watch the video by clicking here [17].

Temporal Displacement and Phase Gain
When the function f (t) has a time shift f (t − t 0 ), its Fourier transform will be, Making a change of variables, We note that the Fourier transform of the shifted function f (t − t 0 ) is equivalent to the transform of the function f (t) times a phase factor associated with the function's temporal shift itself.Conversely, if the function is multiplied by a phase factor f (t)e iω0t , its Fourier transform will present a related shift, We exemplify in Fig. 9 a limited cosine function that presents a temporal displacement, and for a better visualization of the process explained above, we recommend to watch the video by clicking here [18].
As an example, the calculation of the Fourier transform of the finite cosine function will be presented, and it is worth clarifying the transforms obtained, since the function was used as an example to visually represent the last two properties.

Example 5
Since A is a constant, we define the finite cosine function as, Its Fourier transform is, cos ω 0 t sin ωt dt. (38) The second integral is zero because the interval of integration is symmetric and the integrand is an odd function.Making use of Euler's identity, we rewrite the first integral as,  According to this result, as the width of the interval to which the cosine function is defined increases, its Fourier transform narrows, as we can see in Fig. 10.Additionally, the increasing the amplitude of the spectrum is related to the univocal description of the Fourier transform of the function (30).We recommend to watch the video by clicking here [19].

Final considerations
This document was originated from all subjects studied to prepare the undergraduate final monograph, and based on all this information, we decided to condense it into an article format to get a much more width interested public.On the purpose of letting the reader to feel a didactic approach to the Fourier series and transform, observing the images and videos that aim to facilitate the understanding of this important mathematical tool.For this reason, the rigor of the mathematical formalism was not prioritized, but the conceptual description of the theory.In addition, if someone wish to delve deeper into the study of the Fourier transform is invited to consult the bibliography [1,2,4,20,21].
All videos are available on YouTube, so those students who want a better understanding of this tool and teachers who want to use them in their classes can freely use the videos and images.

Figure 1 :
Figure 1: Pictorial representation of a periodic function similar to cardiac activity recorded by an electrocardiogram.

Figure 2 :
Figure 2: Cosine function and the representation of its amplitude spectrum.

Figure 3 :
Figure 3: Sine function and the representation of its amplitude spectrum.

Figure 4 :
Figure 4: Rectangular wave of period T .

Figure 5 :
Figure 5: Rectangular wave and amplitude spectrum for different widths and period of oscillation.

Figure 6 :
Figure 6: Reconstruction of the rectangular wave through the contribution of different terms of the series.

Figure 7 :
Figure 7: Spectrum of the periodic function when its period tends to infinity.

Figure 8 :
Figure 8: Contraction of function and expansion of its frequency spectrum.

Figure 9 :
Figure 9: Fourier transform squared modulus of the constrained cosine function for different displacements.

Figure 10 :
Figure 10: Narrowing of the constrained cosine frequency spectrum over a range.