The Fourier Series and The Discrete Fourier Transform
The Fourier Series and The Discrete Fourier Transform
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.
< 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
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
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
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.
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.