0% found this document useful (0 votes)
93 views9 pages

The Fourier Series and The Discrete Fourier Transform

Uploaded by

guptasugandh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views9 pages

The Fourier Series and The Discrete Fourier Transform

Uploaded by

guptasugandh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

The Fourier Series and the Discrete Fourier Transform

Craig Anderson and Kristian Cozyris


College of the Redwoods
Abstract: The Fourier Series and its applications to the Discrete Fourier Transform are discussed
The paper is written in a colloquial style to avoid intimidating readers who are of a lesser level of
intelligence and ingenuity as the vastly brilliant authors.

Introduction
Deemed one of the crowning achievements of the 20th Century, the Fourier Series has
applications that are far reaching in various fields of science and mathematics. The Discrete
Fourier Transform is one particular tool widely used in today’s age of computers and solid
state electronics. From graphic equalizers in stereos to the most advanced scientific sampling
software, the usefulness of this mathematical feet is astounding.

Linear Algebra
A key idea in Linear Algebra is that a vector can be any abstract object. Take two
arbitrary vectors v and w:
v = Ýv 1 , v 2 , ..., v n Þ
w = Ýw 1 , w 2 , ..., w n Þ
The dot product of two vectors is then the sum of the products of the individual elements
making up the two vectors.
v 6 w = Ýv 1 w 1 + v 2 w 2 + ... + v n w n Þ
Central to the Fourier Series (and consequently the Discrete Fourier Transform) is the fact
that continuous functions can be thought of as vectors. Take two sinusoidal functions f and
g:
fÝxÞ = sinÝxÞ
gÝxÞ = cosÝxÞ
When the dot product of these two continuous function “vectors” is taken, it becomes an
inner product with infinitely many terms...thus an integral.
2^
f6g = < f, g > = X0 sinÝxÞ cosÝxÞdx

The integrals of certain trigonometric functions (evaluated from zero to twice pi, the period
of sinusoidal functions) turn out to be zero. (their inner products are zero).
2^
< sinÝmxÞ, cosÝnxÞ > = X0 sinÝmxÞ cosÝnxÞdx = 0 , for any integer m and n
2^
< sinÝmxÞ, sinÝnxÞ > = X0 sinÝmxÞ sinÝnxÞdx = 0 , m ® n
2^
< cosÝmxÞ, cosÝnxÞ > = X0 cosÝmxÞ cosÝnxÞdx = 0 , m ® n

1
2 A Scientific Report

Thus by the omnipotent laws of Linear Algebra, the function “vectors” are orthogonal and
can span a space of periodic functions. This means that any element in the function “space”
can be written as a linear combination of these basis vector functions.

The Fourier Series


Now that we have established the concept of a set of functions that are orthogonal to one
another we are ready to approach the Fourier Series. It is a fundamental concept in linear
algebra that a given set of orthogonal vectors span a space that has a dimension equal to the
number of vectors in the set. For instance, if we have three mutually orthogonal vectors we
can think of them as spanning Cartesian 3-space. From this follows the concept that any
object in Cartesian 3-space can be described as a linear combination of these basis vectors.
The coefficients of this linear combination are regarded as that objects coordinates. The set
of orthogonal functions that compose the Fourier series can be thought of as spanning the
space of periodic functions. Thus, analogous to the vectors that span 3-space, this means that
a periodic function can be described as a linear combination of the Fourier basis functions.

fÝtÞ = a 0 + a 1 cosÝg 0 tÞ + b 1 sinÝg 0 tÞ + a 2 cosÝ2g 0 tÞ + b 2 sinÝ2g 0 tÞ + ...


= a 0 + F Kn=1 Ýa n cosÝng 0 tÞ + b n sinÝng 0 tÞÞ
where fÝtÞ is a periodic function and g 0 = 2^T
is the fundamental angular frequency of the
function (more on this later).
It should be noted that not all periodic functions are included in this span. A periodic
function must satisfy three criteria known as the Dirichlet conditions. These conditions are
as follows:
t fÝtÞ is piecewise continuous.
t fÝtÞ has isolated maxima and minima.
t fÝtÞ is absolutely integrable over a period.
The challenge of the Fourier series now becomes to find the coefficients. This is where
the concept of orthogonality really becomes our friend! If we wish to find the coefficient a 0
we take the inner product of each side of the equation with 1 (1 is the orthogonal function
associated with a 0 ). We will then utilize the distributive property of the inner produce to
eliminate all of the terms on the right side of the equation except the one including the
desired coefficient.
< 1, fÝtÞ > = < 1, a 0 + a 1 cosÝg 0 tÞ + b 1 sinÝg 0 tÞ + ... >
< fÝtÞ, 1 > = < 1, a 0 > + < 1, a 1 cosÝg 0 tÞ > + < 1, b 1 sinÝg 0 tÞ > +...
T T T T
X 0 fÝtÞdt = X 0 a 0 dt + X 0 a 1 cosÝg 0 tÞdt + X 0 b 1 sinÝg 0 tÞdt > +...
T
X 0 fÝtÞdt = a 0 T + 0 + 0 + ...
T
X 0 fÝtÞdt
a0 =
T
Thus we have a general formula for finding the constant term, commonly called the D.C.
coefficient. Now let’s take a general approach to finding the a k coefficients.
A Scientific Report 3

< cosÝkg 0 tÞ, fÝtÞ > = < cosÝkg 0 tÞ, a 0 + a 1 cosÝg 0 tÞ + b 1 sinÝg 0 tÞ + ... + a k cosÝkg 0 tÞ + ...
T T T T
X 0 fÝtÞ cosÝkg 0 tÞdt = X 0 a 0 cosÝkg 0 tÞdt + X 0 a 1 cosÝkg 0 tÞ cosÝg 0 tÞdt + X 0 b 1 cosÝkg 0 tÞ sinÝg 0 tÞdt + ...
T
... + X a k cos 2 Ýkg 0 tÞdt + ...
0
T T
X 0 fÝtÞ cosÝkg 0 tÞdt = 0 + 0 + 0 + ...a k X 0 cos 2 Ýkg 0 tÞdt
We will do a little side calculation to evaluate the right most integral. . .
T T
X 0 cos 2 Ýkg 0 tÞdt = X 0 1 + cosÝkg 0 tÞ dt
2 2
sinÝkg 0 tÞ T= g2^0
= 1 ßt + à0
2 kg 0
= T
2
And back to our original goal . . .
T
X 0 fÝtÞ cosÝkg 0 tÞdt = 0 + 0 + 0 + ...a k T2
T
ak = 2
T
X 0 fÝtÞ cosÝkg 0 tÞdt
We now have a general way to find the a 0 and the a k coefficients. To complete the
picture we will perform the same trickery on for the b k coefficients.
< sinÝkg 0 tÞ, fÝtÞ > = < sinÝkg 0 tÞ, a 0 + a 1 cosÝg 0 tÞ + b 1 sinÝg 0 tÞ + ... + a k cosÝkg 0 tÞ + ... >
T T T T
X 0 fÝtÞ sinÝkg 0 tÞdt = X 0 a 0 sinÝkg 0 tÞdt + X 0 a 1 sinÝkg 0 tÞ cosÝg 0 tÞdt + X 0 b 1 sinÝkg 0 tÞ sinÝg 0 tÞdt + ...
T
... + X b k sin 2 Ýkg 0 tÞdt + ...
0
T T
X 0 fÝtÞ sinÝkg 0 tÞdt = 0 + 0 + 0 + ... + b k X 0 sin 2 Ýkg 0 tÞdt + ...
T
X 0 fÝtÞ sinÝkg 0 tÞdt = b k T2
T
bk = 2
T
X 0 fÝtÞ sinÝkg 0 tÞdt
In order to put the concept in the proper perspective it only seems appropriate to walk
through an example of how this series approximates a specific function. Let’s consider a
function that has practical applications in cathode ray tubes known as the “sawtooth” wave.
4 A Scientific Report

2
amplitude
1

-10 -5 0 5 10
time
-1

-2

-3

Figure 1. The “sawtooth” wave.


We need to note three things about this graph. First, the period is 2^ which leads to
g 0 = 2^
2^
= 1. Second, the period begins at ?^ and ends at ^. Third, and most importantly,
the equation for this function is fÝtÞ = t for t = ß?^, ^à .
Let us find the Fourier coefficients for this function.
T
a0 = 1
T
X 0 fÝtÞdt
^
X ?^ tdt
=
2^
= 1 ßt 2 à ^?^
4^
=0
There will be no a 0 coefficients.
Tf
ak = 2
T
XT i
fÝtÞ cosÝkg 0 tÞdt
^
2X t cosÝktÞdt
?^
=
2^
t cosÝktÞ
sinÝktÞ
1 k
cosÝktÞ
0 k2

= 1 ßtk sinÝktÞ + cosÝktÞà ^


?^
^k 2
=0
Nor will there be any cosine terms.
A Scientific Report 5

Tf
bk = 2
T
XT fÝtÞ sinÝkg 0 tÞdt
i
^
2X t sinÝktÞdt
?^
=
2^
t sinÝktÞ
1 ? cosÝktÞ
k

0 ? sinÝktÞ
k2

= 1 ßtk cosÝktÞ + sinÝktÞà ^


?^
^k 2
2^k cosÝk^Þ
=
^k
2Ý?1Þ n+1
= n
We can now represent the sawtooth function as a series of sine functions with the b k
coefficients as derived above.
2Ý?1Þ n+1
fÝtÞ = F Kn=1 n sinÝntÞ
= 2 sinÝtÞ ? sinÝ2tÞ + 2 sinÝ3tÞ ? 1 sinÝ4tÞ + 2 sinÝ5tÞ...
3 2 5
Of course, in real applications we cannot carry the series out an infinite number of terms.
We must limit the number of terms to a reasonable approximation of the original function.
The following series of plots shows the progression from the second to the sixth iteration and
the last shows 100 iterations.
6 A Scientific Report
A Scientific Report 7

The approximation improves with each iteration and the plots are nearly
indistinguishable by n=100. The next plot shows each of the sinusoidal functions that sum
up improves the 5th iteration.

1.5

0.5

-0.5

-1

-1.5

-2
-3 -2 -1 0 1 2 3

Figure 2. The superposition of the first five iterations.


A careful analysis of this plot will show that the frequency of the five plots on these axes are
integer multiples of the frequency of the original function. This is not a mere coincidence,
this is exactly what the Fourier series does. It takes a periodic function of a given frequency
(f = T1 ) and expresses it as a sum of sinusoids that are integer multiples of that frequency.
The frequency of the original function is regarded as the fundamental frequency. This forms
the cornerstone concept of the Discrete Fourier Transform.
As a matter of convention, the Fourier series is often depicted in its exponential form
rather than the trigonometric form outlined up until now. If we consider the coefficients a k
and b k as coordinate pairs in the plane then we can also think of them as cosine and sine
coordinates in relation to an angle theta.
a k cosÝkg 0 tÞ + b k sinÝkg 0 tÞ = cosÝS k Þ cosÝkg 0 tÞ + sinÝS k Þ sinÝkg 0 tÞ
= cosÝkg 0 t + S k Þ
To make the final transition you will need to recall this calculus II identity.
8 A Scientific Report

iÝkg 0 t+S k Þ
cosÝkt + S k Þ = e + e ?iÝkg 0 t+S k Þ
2
1
= e e iS k ikg 0 t
+ 1 e ?iS k e ?ikg 0 t
2 2
where; X k = e , and X ?k = 1 e ?iS k
1 iS k
2 2
k=K ikg 0 t
thus, fÝtÞ = F k=?K e
As you can see this introduces complex numbers to the series. It becomes a new matter to
interpret the series as a depiction of real phenomena. Regardless, this form is clearly more
compact and is regarded as the most elegant form of the Fourier series.

The Discrete Fourier Transform


At this point one could either regard the Fourier series as a powerful tool or simply a
mathematical contrivance. It may seem rather silly to rewrite a known function as a set of
sinusoids simply to show that it can be done. The fact is up until now we have only been
developing the theory for the real power of the Fourier series which is the Discrete Fourier
Transform.
Periodic phenomena occur everywhere in the physical world. Every thing that we see
can be broken down to a complex web of wavelengths. Every thing that we hear is
transmitted to our brain by our ear’s cochlea as a spectrum of frequencies. Nearly every type
of communication is achieved my manipulating some sort of periodic phenomena. For this
reason it becomes advantageous for us to have a mastery over the mathematics that govern
these phenomena. The only problem is nature rarely delivers an equation to accompany its
complexities.
As is the case with most of life’s difficult situations we now resort to breaking the
problem into a series of smaller steps. Let’s say that we have some sort of complex sound
and we want to determine each of the sound wave frequencies that it is composed of. The
first thing we would want to do is compile some sort of data that could represent this sound
numerically. In the case of sound, this would like lead us to some sort of recording device.
The first thing that we will do is press the record button and let the data pour in until we
press the stop button. Let’s say that we record for 4 seconds. As mundane as this sounds so
far this is actually an extremely important aspect of the Fourier Transform. Due to the
limitations of time and our machinery we are only able to interpret phenomena over a finite
quantity of time, in our case four seconds. Thus, by starting and stopping our recording we
have done what is known as “windowing” our data.
However, we have not broken things down into small enough steps quite yet. Although,
we are now merely dealing with a finite chunk of reality we still have a complex sound with
no known mathematical description. What we can now do is measure the intensity of our
sound at equal intervals of time. This is known as sampling. First we will pick the interval
of time that will pass between each measurement. We will want that interval to be as short
as possible thus our main limitation probably be our equipment. Let’s say that we can take a
measurement every .1 seconds. Thus, we can take 10 samples per second which is referred
to as our sampling rate. This will give us a total of 40 samples of the sound phenomena
Now that we have windowed and sampled our data we can apply the Fourier magic to
discover its constituent frequencies. The equation changes a little when we deal with
discrete samples rather than a continuous function.
A Scientific Report 9

xÝnAtÞ = AfF N?1


n=0 X k ÝkAfÞe
i2^kAf n At

Note that this adds the mathematical discrete time interval of the samples delta t and the
frequency interval delta f. Also note that N represents the total number of samples taken.
This is actually known as the ”inverse DFT.” The actual DFT equation returns a set of
coefficients for a given sample value.
XÝkAfÞ = AtF N?1
n=0 xÝnAtÞe
?i2^kAf n At

These equations looks very intimidating but it is only a step farther than the last depiction.
Now let’s return to our sound example. As a matter of convention we will want to find
the same number of Fourier coefficients for each data sample as number of data samples we
have. Thus, we will want to find the first 40 Fourier coefficients for each of these samples.
This leads us to a 40 by 40 matrix with columns being time entries and rows being
frequencies. If we set out to compute each of these entries by hand it will not take long to
realize that this requires a whole lot of pencil lead and even more patience! This matrix
requires1600 individual calculations!
This leads us to implement the use of modern computers to perform these computations
for us. However even with the amazingly high clock speeds of today’s Pentium machines,
calculating the DFT requires a substantial amount of time for all but the shortest windows of
data. This fact led to the development of the Fast Fourier Transform (FFT). Although the
details of the FFT algorithm are beyond the scope of this article it should be noted that the
essential mathematics remains unchanged. It merely performs the computations extremely
quickly.

Conclusion
Without the powerful mathematics behind the Fourier Series and more importantly the
Fourier Transform, the 20th Century would be as destitute as the 8th. The mere simple task
of tuning your Rob-E-BASS cd player to reverberate successfully throughout your car cabin,
or viewing “I Know What You Did Last Summer” on high definition T.V. would be
impossible. Science would not have the privilege of high-tech wave-sampling software. We
would all be subject to darkness, pestilence, terror and plague. It is no understatement that
the DFT is considered one of the crowning achievements of the 20th Century. It has been an
honor and a privilege to bring it to you, the reader, in this user friendly, low fat and no
cholesterol form.

Bibliography
t Leon, Steven. Linear Algebra With Applications. Prentice Hall, New York, 1998.
t Strang, Gilbert. Introduction To Linear Algebra. Cambridge Press, Massachusetts, 1998.
t Burden, Richard L. Numerical Analysis. Brook/Cole, Albany, 1997.
t Ramirez, Robert W. The FFT: Fundamentals and Concepts. Prentice Hall, New York, 1985.
t Lyons, Richard. Understanding Digital Signal Processing. Addison Wesley, Menlo Park,
CA, 1998.
t Arnold, Dave. I Am The Resource For All That Is Math: A Contemporary Perspective
C.R., CA, 1998.

You might also like