Introduction

Fourier Transform is a mathematical tool created by Joseph Fourier. Fourier Series and Transform has massive applications in math, science, and computer science, specifically in signal processing. At the end of this demonstration you have a good idea about:

  1. What the Fourier Transform does
  2. Some practical applications of the Fourier Transform
  3. Some pointless but awesome uses of the Fourier Transform

Why was the Fourier Series created?

Jean Baptiste Joseph Fourier made significant contributions to the study of trigonometric series. He introduced the topic of Fourier series in the discussion of the heat equation in physics. The heat equation is a partial differential equation, which didn’t have a general solution until fourier but some specific solutions to it were known such as the solutions to sines and cosine waves. So Fourier proposed that if they represented a given function as a sum of sines and cosines they would be able to find a general solution for the heat equation because they could just apply the solutions from the previously known solutions of sines and cosines to find the general solution of any given function.

But although the initial motivation for Fourier Analysis was in the study of the heat equation, it now has applications in electrical engineering, vibration analysis, acoustics, optics, signal processing, image processing, quantum mechanics, econometrics, thin-walled shell theory, etc.

Real Valued Functions

The most simple application of Fourier series is to find the approximation of a periodic function as a set of sine and cosine waves.

The Fourier Series for a periodic function \(f(x)\) with a period \(T\) is

$$f(x) = \frac{a_0}{2} * \sum_{k=1}^{N}(a_n \cos(\frac{2\pi nx}{T}) + b_n\sin(\frac{2\pi nx}{T}))$$

for some set of Fourier coefficient \(a_k\) and \(b_k\), defined by integrals

$$a_n = \frac{2}{T} \int_{0}^{T}f(x) \cos(\frac{2 \pi n x}{T})dx$$ $$ b_n= \frac{2}{T} \int_{0}^{T}f(x) \sin(\frac{2 \pi nx}{T})dx $$

So to compute the fourier series for a given function \(f\), we only need to compute the the set of integrals above for an arbitrary value of \(n\) to get the set of constants for \(a_n\) and \(b_n\).

As many high school trignometry students learn, sines and cosines can be found by looking at the x and y values of the unit circle. But what they may not know is that by adjusting the radius of the unit circle and making it bigger or smaller we can change the amplitude of our sine and cosine waves. Moreover by adding a value inside our sine and cosine functions we can change the starting angle in our circle and thus change the phase. Finally with Euler's Formula we can make the fourier series calculation and formula remarkably more elegent and efficient and give way to formulas for other fourier analysis equations. Using a trignometric Identity: $$A_n * \cos( \frac{2\pi nx}{T} - \phi_n) = A_n * \cos(\phi_n) * \cos(2\pi nx) + A_n * \sin(\phi_n) * \sin(2\pi nx)$$

Where in this case \(a_n = A_n * cos(\phi_n)\) and \(b_n = A_n * sin(\phi_n)\). But now you may be asking, ok... we traded 2 annoying constants with 2 different annoying constants. Whats the big deal? In this case \(A_n\) represents the amplitude or how large a circle is and \(\phi_n\) represents the phase or what angle we start off at.

But now the question remains, how do we get these simpler coefficients? We can get our amplitude with pythagorean theorem, so \(A_n = \sqrt{a_n^2 + b_n^2}\). We can get our phase with the arctanget function so \(\phi_n = \arctan(b_n/a_n)\). So our fourier series function will now look like this:

$$f(x) = \frac{A_0}{2} + \sum_{n=1}^{N} A_n * \cos( \frac{2\pi nx}{T} - \phi_n)$$

Finally our final simplification is through the use of Euler's formula \(e^{ix} = \cos(x) + i\sin(x)\). And thus the fourier series has taken an elegent form with complex exponentiation:

Since \(e^{ix} = \cos(x) + i\sin(x)\) then \(e^{-ix} = \cos(x) + -i\sin(x)\) meaning that \(\cos(x) = \frac{e^{ix} + e^{-ix}}{2}\)

So using this knowledge we know can apply it to our simplified fourier series equations:

$$ \cos(\frac{2\pi nx}{T} - \phi_n) = \frac{1}{2} e^{i(\frac{2\pi nx}{T} - \phi_n)} + \frac{1}{2} e^{-i(\frac{2\pi nx}{T} - \phi_n)} = \frac{1}{2} * e^{-i * \phi_n} * e^{i * \frac{2\pi nx}{T}} = \frac{1}{2} * e^{i * \phi_n} * e^{i * \frac{2\pi (-n)x}{T}} $$

Therefore with the definitions for 1 complex constant which is able to encode both amplitude and position we can simplify our calculations.

$$c_n = \frac{1}{T} \int_{T} f(x) * e^{-i \frac{2\pi nx}{T}}$$

Finally our fourier series takes a elegent and simple form

$$f_N(x) = \sum_{n = -N}^{N} c_n * e^{i \frac{2\pi nx}{T}}$$

Finally to solve for a given functions fourier series we just need to set an arbitrary \(n\) and calcuate the the set of complex constants which we can numerically or analytically integrate. In the most basic cases such as deconstructing a wave we only use the real portion of our fourier series and disregard the complex component. However you will see later the power of using these two components in concert.

To use this demonstration create the desired wave by clicking above or below the line. Once the desired outcome is reached click the start button to start the Fourier Series. You can adjust the maximum frequency magnitude if you want to increase or decrease the number of rotating circles based on their frequency. You can also speed up or slow down the demonstration by increasing or decreasing the time scale. If you want to pause the demonstration and adjust your wave, press the pause button.

Maximum Absolute Frequency

Time Scale

Complex Functions

In the last step of our fourier series derivation we were able to simplify our fourier series calculation to a simple complex exponential:

$$f_N(x) = \sum_{n = -N}^{N} c_n * e^{i \frac{2\pi nx}{T}}$$ $$c_n = \frac{1}{T} \int_{T} f(x) * e^{-i \frac{2\pi nx}{T}}$$

In a simple wave deconstruction problem we only need to use the real portion of the complex exponential. However we can represent a 2 dimensional shape as a complex periodic function and thus find the fourier series for the path using both real and complex components of the complex exponential.

Maximum Absolute Frequency

Time Scale

More Information

I hope this demonstration provided about effective overview about Fourier Series. For more information please view these resources:

This project was inspired by this 3Blue1Brown's video about fourier series.

Another really interesting resource was Jez Swanson's an Interactive Introduction to Fourier Transforms which has its own epicycle demonstrations and some other cool applications for fourier analysis. Both of these resources served as massive inspirations for this project and massive sources of information. If you want to see the derivation for the fourier series in more detail check out the Fourier Series wikipedia article . For any one looking to learn more about Fourier Analysis these resources are great starting points.