3  Fourier Series and Fourier Transform

Learning Objectives

After reading this chapter, you should be able to:

3.1 Motivation

So far in the previous chapter we looked at the response of a single degree of freedom system excited by a sinusoidal force. We know that eventually when we want to compute the motions of a ship or offshore structure in the ocean, the excitation due to waves and wind will not be sinusoidal but will be random. Thus, there is a need to understand how we can scale from the simple case of sinusoidal forcing to a random forcing. In this chapter we will move towards this by learning about Fourier series and Fourier transforms.

3.2 Fourier series

In the previous chapter we looked at a sinusoidal forcing of the type \(F(t) = F_0 cos(\omega t)\). This forcing as seen in Figure 3.1 will repeat itself over time and has a period of \(T = 2\pi/\omega\).

Figure 3.1: Sinusoidal forcing \(F(t) = F_0 \cos(\omega t)\) with \(F_0 = 1\) and \(\omega = 1\)

Now let’s consider a funtion \(F(t)\) that is continuous and periodic over the time interval \([-\frac{T}{2}, \frac{T}{2}]\). An example is shown in Figure 3.2, where the function is periodic with a period \(T=2\pi\) but is not sinusoidal.

Figure 3.2: Non-sinusoidal forcing \(F(t)\) with period \(T=2\pi\)

Fourier showed that as long as the function \(F(t)\) is smooth, continuous and periodic, it can be expressed as a trignometric series:

\[\begin{align} F(t) = \frac{a_0}{2} + \sum_{k=1}^{\infty} a_k \cos(k\omega_0 t) + b_k \sin(k\omega_0 t) \label{eq-real-fourier-series} \end{align}\]

where \(\omega_0 = 2\pi/T\) is known as the fundametal frequency of the Fourier series and \(T\) is the fundametal period of the function.

We will now compare this exercise of expressing a function as a Fourier series with the more familiar concept of projecting a vector in 3D vector space along its basis vectors. We know that in 3D space, a vector \(\vec{\boldsymbol{r}}\) is expressed in terms of its projection along the basis vectors as:

\[\begin{align} \vec{\boldsymbol{r}} = a \boldsymbol{\hat{i}} + b \boldsymbol{\hat{j}} + c \boldsymbol{\hat{k}} \end{align}\]

where \(\boldsymbol{\hat{i}}\), \(\boldsymbol{\hat{j}}\) and \(\boldsymbol{\hat{k}}\) are unit vectors along the cardinal directions (\(x\), \(y\) and \(z\) directions) and the values \(a\), \(b\) and \(c\) are the projection of the vector \(\vec{\boldsymbol{r}}\) along \(\boldsymbol{\hat{i}}\), \(\boldsymbol{\hat{j}}\) and \(\boldsymbol{\hat{k}}\).

We can think of a Fourier series as projecting the funtion \(F(t)\) along the basis functions \(\cos(k\omega_0 t)\) and \(\sin(k\omega_0 t)\) for \(k=1,2,...,\infty\). The only difference here is that we are projecting functions into function space and unlike the 3D vector space that has only 3 basis vectors, here we have infinte number of basis functions. The coefficients \(a_k\) and \(b_k\) denote the projection of the function \(F(t)\) along \(\cos(k\omega_0 t)\) and \(\sin(k\omega_0 t)\) respectively.

In the vector space, the cardinal vectors \(\boldsymbol{\hat{i}}\), \(\boldsymbol{\hat{j}}\) and \(\boldsymbol{\hat{k}}\) are orthogonal to each other. This means that when we project one cardinal vector along another, the projection is zero. This idea of projecting one vector along another is denoted by the dot product (or scalar product) operation and the orthogonality is expressed mathematically as:

\[\begin{align} \boldsymbol{\hat{i}}.\boldsymbol{\hat{j}} = \boldsymbol{\hat{i}}.\boldsymbol{\hat{k}} = \boldsymbol{\hat{j}}.\boldsymbol{\hat{k}} = 0 \label{eq-vec-orthogonality} \end{align}\]

The idea of dot product also transfers over to the function spaces. The dot product between two functions \(f(t)\) and \(g(t)\) with domain \([-\frac{T}{2}, \frac{T}{2}]\) is defined as:

\[\begin{align} <f,g> = \int_{-T/2}^{T/2} f(t) g^{*}(t) dt \end{align}\]

where \(g^{*}(t)\) is the complex conjugate of \(g(t)\). If the functions are real valued, then the dot product reduces to:

\[\begin{align} <f,g> = \int_{-T/2}^{T/2} f(t) g(t) dt \end{align}\]

Just as we had the orthogonality of basis vectors as shown in \(\eqref{eq-vec-orthogonality}\), the basis functions \(\cos(k\omega_0 t)\) and \(\sin(k\omega_0 t)\) for \(k=1,2,...,\infty\) are also orthogonal to each other.

\[\begin{align} <\cos(k\omega_0 t), \cos(m\omega_0 t)> &= \int_{-T/2}^{T/2} \cos(k\omega_0 t) \cos(m\omega_0 t) dt \nonumber \\ &= \int_{-T/2}^{T/2} \frac{1}{2}\left\{\cos((k+m)\omega_0 t) + \cos((k-m)\omega_0 t)\right\} dt \nonumber \\ &= \begin{cases} 0 & \text{for } k \neq m \\ \frac{T}{2} & \text{for } k = m \end{cases} \end{align}\]

\[\begin{align} <\sin(k\omega_0 t), \sin(m\omega_0 t)> &= \int_{-T/2}^{T/2} \sin(k\omega_0 t) \sin(m\omega_0 t) dt \nonumber \\ &= \int_{-T/2}^{T/2} \frac{1}{2}\left\{\cos((k-m)\omega_0 t) - \cos((k+m)\omega_0 t)\right\} dt \nonumber \\ &= \begin{cases} 0 & \text{for } k \neq m \\ \frac{T}{2} & \text{for } k = m \end{cases} \end{align}\]

\[\begin{align} <\cos(k\omega_0 t), \sin(m\omega_0 t)> &= \int_{-T/2}^{T/2} \cos(k\omega_0 t) \sin(m\omega_0 t) dt \nonumber \\ &= \int_{-T/2}^{T/2} \frac{1}{2}\left\{\sin((k+m)\omega_0 t) - \sin((k-m)\omega_0 t)\right\} dt \nonumber \\ &= 0 \end{align}\]

Using the orthogonality, the coefficients of the Fourier series can be found as:

\[\begin{align} a_0 &= \frac{1}{T} <F, \cos(0 \times \omega_0 t)> = \frac{1}{T} <F, 1> \\ a_k &= \frac{2}{T} <F, \cos(k \omega_0 t)> \\ b_k &= \frac{2}{T} <F, \sin(k \omega_0 t)> \end{align}\]

Figure 3.3 shows the Fourier series approximation of the non-sinusoidal function shown in Figure 3.2 as we progressively increase the number of terms considered for summation. It can be seen that with 10 terms the match is fairly good.

Figure 3.3: Non-sinusoidal forcing \(F(t)\) with period \(T=2\pi\) and its Fourier series approximation

3.3 Complex Fourier series

For a real valued function \(F(t)\) defiend over \([-\frac{T}{2}, \frac{T}{2}]\), the Fourier series is given by \(\eqref{eq-real-fourier-series}\). This can further be expressed in terms of complex basis functions as:

\[\begin{align} F(t) &= \frac{a_0}{2} + \sum_{k=1}^{\infty} a_k \cos(k\omega_0 t) + b_k \sin(k\omega_0 t) \nonumber \\ &= \frac{a_0}{2} + \sum_{k=1}^{\infty} \frac{1}{2} \left[(a_k - ib_k)e^{ik\omega_0 t} + (a_k + ib_k)e^{-ik\omega_0 t} \right] \nonumber \\ &= \sum_{k=-\infty}^{\infty} c_k e^{ik\omega_0 t} \end{align}\]

where:

\[\begin{align} c_k = \begin{cases} \frac{1}{2} a_0 & k = 0 \\ \frac{1}{2} (a_k - ib_k) & k > 0 \\ \frac{1}{2} (a_k + ib_k) & k < 0 \end{cases} \end{align}\]

The same principle of orthogonality also holds for the complex basis functions too as shown below:

\[\begin{align} <e^{ik\omega_0 t}, e^{im\omega_0 t}> &= \int_{-T/2}^{T/2} e^{ik\omega_0 t} e^{-im\omega_0 t} dt \nonumber \\ &= \begin{cases} 0 & k \neq m \\ T & k = m \end{cases} \end{align}\]

Using the orthogonality, the coefficients of the Fourier series can be found as:

\[\begin{align} c_k = \frac{1}{T}<F, e^{ik\omega_0 t}> \end{align}\]

It is interesting to note that for a real function \(F(t)\), the complex Fourier coefficients have a symmetry as shown below:

\[\begin{align} c_{-k} = c_k^{*} \end{align}\]

3.4 Fourier transform

The Fourier series we have discussed so far for functions periodic over a finite domain \([-\frac{T}{2}, \frac{T}{2}]\). Note that the consecutive term frequencies are discretely separated by the fundamental frequency \(\omega_0\). The Fourier series can be written as:

\[\begin{align} F(t) &= \sum_{k=-\infty}^{\infty} c_k e^{ik\omega_0 t} \nonumber \\ &= \sum_{k=-\infty}^{\infty} \frac{1}{T}<F, e^{ik\omega_0 t}> e^{ik\omega_0 t} \nonumber \\ &= \sum_{k=-\infty}^{\infty} \frac{\omega_0}{2\pi} \int_{-T/2}^{T/2} F(\xi)e^{-ik\omega_0 \xi} d\xi ~e^{ik\omega_0 t} \end{align}\]

We now extend this idea of Fourier series to functions defined over the domain \((-\infty, \infty)\) by taking the limit \(T \rightarrow \infty\). Note that this means that the fundamental frequency \(\omega_0 \rightarrow d\omega\) and the sum over a discrete set of frequencies (each consecutive one separated by \(\omega_0\)) can be considered as an integral over continuous set of frequencies \(\omega\) in the limit.

\[\begin{align} F(t) &= \lim_{\substack{T\rightarrow \infty \\ \omega_0 \rightarrow d\omega}} \sum_{k=-\infty}^{\infty} \frac{\omega_0}{2\pi} \int_{-T/2}^{T/2} F(\xi)e^{-ik\omega_0 \xi} d\xi ~e^{ik\omega_0 t} \nonumber \\ &= \frac{1}{2\pi} \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} F(\xi)e^{-i\omega \xi} d\xi ~e^{i\omega t} d\omega \end{align}\]

The inner integral is the Fourier transform of the continuous function \(F(t)\) defined over the domain \((-\infty, \infty)\).

\[\begin{align} \hat{F}(\omega) = \mathcal{F}(F(t)) = \int_{-\infty}^{\infty} F(t)e^{-i\omega t} dt \end{align}\]

Similarly the outer integral is the inverse Fourier transform of the continuous function \(\hat{F}(\omega)\) defined over the domain \((-\infty, \infty)\).

\[\begin{align} F(t) = \mathcal{F}^{-1}(\hat{F}(\omega)) = \frac{1}{2\pi} \int_{-\infty}^{\infty} \hat{F}(\omega) e^{i\omega t} d\omega \end{align}\]

The two integrals are known as Fourier transform pair. Both integrals converge as long as \(\int_{-\infty}^{\infty} |F(t)| dt < \infty\) and \(\int_{-\infty}^{\infty} |\hat{F}(\omega)| d\omega < \infty\). The Fourier transform and inverse Fourier transform are both linear operators and accommodate the principle of superposition.

\[\begin{align} \mathcal{F}(af(t) + bg(t)) &= a \mathcal{F}(f) + b \mathcal{F}(g) = a \hat{f}(\omega) + b \hat{f}(\omega) \\ \mathcal{F}^{-1}(a\hat{f}(\omega) + b\hat{g}(\omega)) &= a \mathcal{F}^{-1}(\hat{f}) + b \mathcal{F}^{-1}(\hat{g}) = a f(t) + b f(t) \end{align}\]

The Fourier transform gives us another way to compute the derivative of a function.

\[\begin{align} \frac{dF}{dt} &= \frac{d}{dt} \left(\frac{1}{2\pi}\int_{-\infty}^{\infty} \hat{F}(\omega)e^{i\omega t} d\omega\right) \nonumber\\ &= \frac{1}{2\pi}\int_{-\infty}^{\infty} \hat{F}(\omega)\frac{d}{dt}\left(e^{i\omega t}\right) d\omega \nonumber\\ &= \frac{1}{2\pi}\int_{-\infty}^{\infty} \hat{F}(\omega) i\omega e^{i\omega t} d\omega \nonumber\\ &= \mathcal{F}^{-1}(i\omega \hat{F}(\omega)) \end{align}\]

Thus the Fourier transform of a derivative is equivalent to mulitplying the Fourier transform of the function with \(i\omega\). This usefult property allows converting partial differntial equations into ordinary differential equations. We will use this property later when we discuss hydrodynamics of floating structures.

Another useful property of the Fourier transform is that it converts the convolution operation between two functions in the time domain into a product operation in the frequency domain. The convolution operation between two functions \(f(t)\) and \(g(t)\) is defined as:

\[\begin{align} f * g (t) = \int_{-\infty}^{\infty} f(\tau)g(t - \tau) d\tau \end{align}\]

The Fourier transform of the convolution operation yields:

\[\begin{align} \mathcal{F}(f * g) &= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(\tau)g(t - \tau) d\tau e^{-i\omega t} dt \nonumber \\ &= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(\tau)g(t - \tau) e^{-i\omega (t-\tau)} e^{-i\omega \tau}d\tau dt \nonumber \\ &= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(\tau)g(t - \tau) e^{-i\omega (t-\tau)} dt e^{-i\omega \tau}d\tau \nonumber \\ &= \int_{-\infty}^{\infty} f(\tau) \int_{-\infty}^{\infty} g(\xi) e^{-i\omega \xi} d\xi e^{-i\omega \tau}d\tau \nonumber \\ &= \int_{-\infty}^{\infty} f(\tau) \hat{g}(\omega) e^{-i\omega \tau}d\tau \nonumber \\ &= \int_{-\infty}^{\infty} f(\tau) e^{-i\omega \tau}d\tau \hat{g}(\omega)\nonumber \\ &= \hat{f}(\omega) \hat{g}(\omega) \end{align}\]

We will be seeing the convolution operation later down in the course when we discuss impulse response functions (IRFs) and Cummins equations.