Fourier Analysis and Laplace Transforms

George E. Hrabovsky

MAST

Introduction

In the last lesson we saw how several PDEs in DSolve resulted in an answer involving Fourier series. In this lesson we examine how Mathematica handles Fourier series and Fourier transforms. We will then discuss Laplace transforms.

Fourier Series

How do we generate a Fourier series in Mathematica? We use the FourierSeries command.

l8_1.png

l8_2.png

The nth-order Fourier series has the form,

l8_3.png

(8.1)

where the coefficients are given as,

l8_4.png

(8.2)

In general, if we have a differential operator L such that for the functions u and v L(u+v)=L(u)+L(v) and for the constant or parameter c L(c u)=c L(u) then we say that the operator is linear. Any operator that is not linear is called nonlinear. It turns out that we can write any linear differential equation using a linear operator

So what does the output look like? Here is the second-order Fourier series for t.

l8_5.png

l8_6.png

We can see the role of the Parameters by specifying their values as {a,b}.

l8_7.png

l8_8.png

The default values are {1,1}. Here is what happens when we apply the condition that the parameters are {1,2 π}.

l8_9.png

l8_10.png

Here is a plot of this.

l8_11.png

l8_12.gif

Here we see five zeros. How do we know these are zeros and not just poles? Zeros go from -π to π in a counterclockwise manner. Poles go clockwise.

We can also find the Fourier sine series.

l8_13.png

l8_14.png

And we can find the cosine series.

l8_15.png

l8_16.png

We can even find the Fourier coefficients. Here we have a table of the first five coefficients.

l8_17.png

1 l8_18.png
2 l8_19.png
3 l8_20.png
4 l8_21.png
5 l8_22.png

Here are the first five Fourier sine coefficients.

l8_23.png

1 l8_24.png
2 l8_25.png
3 l8_26.png
4 l8_27.png
5 l8_28.png

Here are the first five Fourier cosine coefficients.

l8_29.png

1 l8_30.png
2 0
3 l8_31.png
4 0
5 l8_32.png

As an exercise work through the documentation on FourierSeries, FourierCoefficient, FourierSinSeries, FourierSinCoefficient, FourierCosSeries, FourierCosCoefficient and work through some examples.

Fourier Transforms

We can also perform Fourier transforms.

l8_33.png

l8_34.png

Compare this result with the Fourier series above .

l8_35.png

l8_36.png

Note that this result is the frequency derivative of the Dirac delta.

l8_37.png

l8_38.png

We can always transform an elementary function.

l8_39.png

l8_40.png

Here the Sign function is defined.

l8_41.png

l8_42.png

We can also transform special functions.

l8_43.png

l8_44.png

l8_45.png

l8_46.png

Periodic functions are what you would expect. Here we transform a common result.

l8_47.png

l8_48.png

We can also use the Fourier sine transform.

l8_49.png

l8_50.png

And the Fourier cosine transform.

l8_51.png

l8_52.png

We can also perform an inverse Fourier transform.

l8_53.png

l8_54.png

As an exercise read through the documentation on FourierTransform, FourierSinTransform, FourierCosTransform, InverseFourierTransform, InverseFourierSinTransform, and InverseFourierCosTransform and work through several examples.

Discrete Fourier Analysis and Spectral Methods

So far, all of this has been about Fourier analysis of defined expressions. What about data? In such a case we use the command Fourier. Let’s say that we have some noisy data.

l8_55.png

We can see a plot of this.

l8_56.png

l8_57.gif

So, we can apply a discrete Fourier transform on the data.

l8_58.png

Now we can plot that .

l8_59.png

l8_60.gif

Too zoomed in for us to see anything, what happens when we expand the view.

l8_61.png

l8_62.gif

We see a very strong spike at a little over a hundred. We see a corresponding, symmetric, spike at a little less than a hundred from the far end.

We can also find the power spectrum of the data. What is that? It is the magnitude of the Fourier transform.

l8_63.png

l8_64.gif

As an exercise read through the documentation for the commands Fourier and Periodogram and work some examples.

As an exercise read through the section Discrete Fourier Transforms of the technical note Numerical Operations on Data, look up the documentation on any new functions in that section, and work some examples.

Laplace Transforms

Fourier transforms take an input function, applies a function called a kernel, and the output function is of a different variable. Such a transform is termed an integral transform, since the application of the kernel to the input function is integrated with respect to the input variable. Another kind of integral transform that is very useful is the Laplace transform. Why use a Laplace transform? Laplace transforms allow you to incorporate initial conditions. It can transform a differential equation into an algebraic equation, you can then solve that algebraic equation, and then apply an inverse Laplace transform to convert the algebraic solution into the solution of the differential equation. [Note about the initial condition as opposed to Fourier transforms].

Here we write an inhomogeneous ODE.

l8_65.png

We apply a Laplace transform to convert t to s.

l8_66.png

l8_67.png

As you can see we have opportunity to define the initial conditions. Let’s assume that the initial conditions are both 0.

l8_68.png

l8_69.png

We now solve this weird equation for the Laplace transform.

l8_70.png

l8_71.png

l8_72.png

l8_73.png

l8_74.png

l8_75.gif

We now apply an inverse Laplace transform to this.

l8_76.png

l8_77.png

Compare this to the direct solution.

l8_78.png

l8_79.png

As an exercise read through the documentation for LaplaceTransform and InverseLaplaceTransform and work some examples.

As an exercise read through the tutorial Integral Transforms and Related Operations and work some examples.

Note that we will discuss the Z transform when we get to solving difference equations in a later lesson.

Created with the Wolfram Language