You are on page 1of 9

Chapter 11.

04
Discrete Fourier Transform
Introduction
Recalled the exponential form of Fourier series (see Equations 18 and 20 from Chapter 11.02),

k
t ikw
k
e C t f
0
~
) (
(18, Ch. 11.02)

'

,
_


T
t ikw
k
dt e t f
T
C
0
0
) (
1 ~
(20, Ch. 11.02)
While the above integral can be used to compute
k
C
~
, it is more preferable to have a discretized
formula version to compute
k
C
~
. Furthermore, the Discrete Fourier Transform (or DFT) [15]
will also facilitate the development of much more efficient algorithms for Fast Fourier
Transform (or FFT), to be discussed in Chapters 11.05 and 11.06.
Derivations of DFT Formulas
If time
t
is discretized at
, ,......., 3 , 2 ,
3 2 1
t n t t t t t t t
n

Then Equation (18, of Chapter 11.02) becomes

1
0
0
~
) (
N
k
t ikw
k n
n
e C t f
(1)
To simplify the notation, define
n t
n

(2)
Then, Equations (1) can be written as

1
0
0
~
) (
N
k
n ikw
k
e C n f
(3)
In the above formula,
n
is an integer counter. However,
) (n f
and
n
t
do NOT have to be
integer numbers.
Multiplying both sides of Equation (3) by
n ilw
e
0

, and performing the summation on


n
, one
obtains ( note: l = integer number)
11.04.1
11.04.2 Chapter 11.04
n ilw
N
n
N
k
n ikw
k
N
n
n ilw
e e C e n f
0 0 0
1
0
1
0
1
0
~
) (



(4)

1
0
1
0
) (
0
~
N
n
N
k
n w l k i
k
e C
(5)

1
0
1
0
2
) (
~
N
n
N
k
n
N
l k i
k
e C

(6)
Switching the order of summations on the right-hand-side of Equation (6), one obtains

,
_

,
_


1
0
1
0
2
) (
1
0
2
~
) (
N
k
N
n
n
N
l k i
k
N
n
n
N
il
e C e n f

(7)
Define

,
_

1
0
2
) (
N
n
n
N
l k i
e A

(8)
There are 2 possibilities for ( 1 k ) to be considered in Equation (8)
Case(1): ( k -l ) is a multiple integer of N , such as

k (
-l ) = mN; or k = l + mN where
,...... 2 , 1 , 0 t t m
Thus, Equation (8) becomes:

1
0
2
N
n
n im
e A

(9)

+
1
0
) 2 sin( ) 2 cos(
N
n
mn i mn
Hence:
N A (10)
Case(2): ( k -l ) is NOT a multiple integer of N
In this case, from Equation (8) one has

,
_

'

1
0
2
) (
N
n
n
N
l k i
e A

(11)
Define:
N
l k i
e a
2
) (

(12)

'

'

)
2
) ( sin )
2
) ( cos
N
l k i
N
l k

; 1 a
because ( k -l ) is NOT a multiple integer of N (13)
Then, Equation (11) can be expressed as

1
0
N
n
n
a A
(14)
From mathematical handbooks, the right side of Equation (14) represents the geometric
series, and can be expressed as
N a A
N
n
n

1
0
if 1 a (15)
Discrete Fourier Transform 11.04.3

a
a
N

1
1
if 1 a (16)
Because of Equation (13), hence Equation (16) should be used to compute A. Thus
a
a
A
N

1
1
(See Equation (12)) (17)

a
e
l k i

1
1
2 ) (
Since ( 1 k ) is still a multiple of 2 , hence
{ } { }

2 ) ( sin 2 ) ( cos
2 ) (
l k i l k e
l k i
+

(18)
1
Substituting Equation (17) into Equation (18), one gets
0 A (19)
Thus, combining the results of case (1) and case (2), one gets (see Equations (10) and Equation
(19))
0 + N A (20)
Substituting Equation (20) into Equation (8), and then referring to Equation (7), one gets


1
0
1
0
~
) (
0
N
k
k
N
n
n ilw
N C e n f
(20a)
Recalled mN l k + (where
m l,
are integer numbers), and since k must be in the range
1 0 N , therefore 0 m . Thus:
mN l k + becomes l k
Equation (20a) can, therefore, be simplified to
N C e n f
l
N
n
n ilw

~
) (
1
0
0
(20b)
Thus

,
_


1
0
0
) (
1 ~ ~
N
n
n ikw
k l
e n f
N
C C
(21)

{ }


,
_

1
0
0 0
) sin( ) cos( ) (
1
N
n
n kw i n kw n f
N
where
n
t n
and

1
0
0
~
) (
N
k
n ikw
k
e C n f (3, repeated)
{ }

+
1
0
0 0
) sin( ) cos(
~
N
k
k
n kw i n kw C
Remarks:
(a) Consider the exponential term in Equation (1). Let
)
2
(
) (
0
n
N
ik
n ikw
e e E

If one replaces
n
by
) ( n N
(or
) ( N n
) into the above equation, then one obtains
11.04.4 Chapter 11.04
[ ] 1
) 2 (
) *
2
( ) (
2



ik
n
N
ik N n
N
ik
e e e
E
Thus, Equation (1) indicates that the force corresponding to frequencies of order
n
and
N n n N ) (
have the same values. Hence
w n w
n

for
2
N
n

w n N ) (
for
2
N
n >
and the frequency corresponding to
2
N
n is the highest frequency that can be considered in
the discrete Fourier series (
2
N
w
is called the Nyquist frequency). If there are harmonic (force)
components above
2
N
w
in the original function, then these higher components will introduce
distortions in the lower harmonic components (known as ALIASING phenomenon). Because
of the ALIASING phenomenon, the number of ( N ) data points should be at least twice the
highest harmonic component presents in the (forcing) function, for sufficient computational
accuracy. As an example, if the forcing function is given as


16
1
) 2 cos( 100 ) (
n
nt t F
then, the minimum value of N ( = Number of sample data points ) should be . 32
min
N
(b) The factor
,
1

,
_

N
shown in the DFT Equation (21), is merely a scale factor. It can also be
placed in the inverse Fourier Transform Equation (1), but not both.
Thus, Equations (21) and (1) can be re written as

,
_

1
0
2
0
) (
~
N
k
n
N
w ik
n
e k f C

(22)

,
_

,
_

1
0
2
0
~ 1
) (
N
n
n
N
w ik
n
e C
N
k f

(23)
To avoid computation with complex numbers, Equation (22) can be expressed as
{ }

'

+ +
1
0
) sin( ) cos( ) ( ) (
~ ~
N
k
I R I
n
R
n
i k f i k f C i C
(22a)
where
n
N
w k
,
_

2
0
(22b)
{ } { }

+ + +
1
0
) sin( ) ( ) cos( ) ( ) sin( ) ( ) cos( ) (
~ ~
N
k
R I I R I
n
R
n
k f k f i k f k f C i C
The above complex number equation is equivalent to the following 2 real number
equations
Discrete Fourier Transform 11.04.5
{ }

+
1
0
) sin( ) ( ) cos( ) (
~
N
k
I R R
n
k f k f C
(22c)
{ }


1
0
) sin( ) ( ) cos( ) (
~
N
k
R I I
n
k f k f C
(22d)
Computer program implementation for the DFT equations (22c, 22d) are given at
http://numericalmethods.eng.usf.edu/simulations/mtl/11fft/dft.m .
Detailed Explanation About Aliasing Phenomenon, Nyquist Samples, Nyquist Rate.
When a function
), (t f
which may represent the signals from some real-life phenomenon
(shown in Figure 1), is sampled, it basically converts that function into a sequence ) (
~
k f at
discrete locations of
. t
These discrete locations are assumed to have equally spaced and the
distance between any 2 samples is . t Thus, ) (
~
k f represents the value of
), (t f
at
,
0
t k t t +
where
0
t
is the location of the first sample
). 0 ( k at
If the sample locations
were done properly, then the original function
), (t f
can be recovered through interpolation
process of these discrete sample values.
Figure 1 Function to be Sampled and Aliased Sample Problem.
In Figure 1, the samples have been taken with a fairly large . t Thus, these sequence of
discrete data will not be able to recover the original signal function
) (t f
. For example, if all
discrete values of
), (t f
were connected by piecewise linear fashion, then a nearly horizontal
straight line will occur between
1
t through
11
t , and
12
t through
16
t
, respectively (See Figure 1).
These piecewise linear interpolation (or other interpolation schemes will NOT produce a curve
which resemble well with the original function
) (t f
. This is the case where the data has been
ALIASED.
11.04.6 Chapter 11.04
Figure 2 Function to be sampled and Windowing Sample Problem.
Another potential difficulty in sampling the function is called windowing problem. As
indicated in Figure 2, while t is small enough so that a piecewise linear interpolation for
connecting these discrete values will adequately resemble the original function
) (t f
, however,
only a portion of the function
) (t f
has been sampled (from
1
t through
12
t ) rather than the
entire one. In other words, one has placed a window over the function.
To avoid aliased phenomenon, the sample space t should be small enough so that the
discrete sequence will recover back the original function
) (t f
. The sampling theorem can be
stated as:
If the function
) (t f
is band-limited with bandwidth
max
2w
,
) (w F
Fourier transform of
0 ) ( t f
for
0
max
> w w
then
) (t f
is uniquely determined by a knowledge of its values at
uniformly spaced intervals t apart, with
max
2
1
w
t
.
The above sampling theorem can be loosely explained through the help of Figure 3.
Discrete Fourier Transform 11.04.7
Figure 3 Frequency of sampling rate (
S
w
) versus maximum frequency content (
max
w
).
To satisfy
0 ) ( w F
, for
max
w w
, the frequency (
w
) should be between points A and B of
Figure 3.
Hence
max max
w w w w
s

which implies
max
2w w
s

Physically, the above equation states that one must have at least 2 samples per cycle of the
highest frequency component present (Nyquist samples, Nyquist rate).
11.04.8 Chapter 11.04
Figure 4 Correctly reconstructed signal.
Figure 5 Wrongly reconstructed signal.
Discrete Fourier Transform 11.04.9
In Figure 4, a sinusoidal signal is sampled at the rate of 6 samples per 1 cycle (or
0
6w w
s

).
Since this sampling rate does satisfy the sampling theorem requirement
( )
max
2w w
s

, the
reconstructed signal does correctly represent the original signal. However, as indicated in
Figure 5 a sinusoidal signal is sampled at the rate of 6 samples per 4 cycles
,
_

0
4
6
w w or
s
.
Since this sampling rate does NOT satisfy the requirement
( )
max
2w w
s

, the reconstructed
signal would wrongly represent the original signal.
References
[1] E.Oran Brigham, The Fast Fourier Transform, Prentice-Hall, Inc. (1974).
[2] S.C. Chapra, and R.P. Canale, Numerical Methods for Engineers, 4
th
Edition, Mc-Graw Hill
(2002).
[3] W.H . Press, B.P. Flannery, S.A. Tenkolsky, and W.T. Vetterling, Numerical Recipies,
Cambridge University Press (1989), Chapter 12.
[4] M.T. Heath, Scientific Computing, Mc-Graw Hill (1997).
[5] H. Joseph Weaver, Applications of Discrete and Continuous Fourier Analysis, John Wiley
& Sons, Inc. (1983).
FAST FOURIER TRANSFORM
Topic Discrete Fourier Transform
Summary Textbook notes on discrete Fourier transform
Major General Engineering
Authors Duc Nguyen
Date April 29, 2012
Web Site http://numericalmethods.eng.usf.edu

You might also like