You are on page 1of 7

Notes on the Discrete Fourier Transform

by
Dr. W. Dan Curtis

Introduction
Suppose we have a signal x(t ) that is periodic of period L. We divide [0,L] into N
equal parts and sample the signal at the evenly spaced times

tn =

nL
, 0 n N 1
N

obtaining the discrete signal

( x(t0 ), x(t1 ),, x(t N 1 )).


Note that we dont sample at t N =
have

NL
= L because, since x(t ) has period L, we would
N

x(t N ) = x(t0 ) .

Complex Sinusoidal Signals


An ordinary sinusoidal function (signal) is a function of the form

x(t ) = A sin(bt ) (or A cos(bt ))


where A is called the amplitude and b is the circular frequency. Recall that the complex
exponential is defined by
eibt = cos(bt ) + i sin(bt ) .
We have

eibt + e ibt
eibt e ibt
sin(bt ) =
and cos(bt ) =
,
2i
2

so we see that anything that can be expressed in terms of sines and cosines can also be
expressed in terms of complex exponentials and vice-versa.
If we want to consider signals having period L, we can express them in terms of
complex exponentials such as

2 it
L

which has period L. In fact, we can define a collection of complex exponential signals
having the property that a whole number of complete periods fits into the interval [0, L]
as follows:

sk (t ) = e

ik t

, 0 k N 1

where

k =
Note that sk (t ) has period

Tk =

2 k
L

L
k

so that exactly k complete periods of sk (t ) fit into the interval [0, L] . We can define a
sampled version of the signal sk (t ) as we did for the general signal x(t ) above:
sk = ( sk (t0 ), sk (t1 ), , sk (t N 1 ))

The Complex Vector Space

and the Inner Product

The space N consists of all complex N-tuples ( z1 , z2 , , z N ) , where each zi is a


complex number. Addition and scalar multiplication are defined as:
( z1 , z2 , , z N ) + ( w1 , w2 , , wN ) = ( z1 + w1 , z2 + w2 , , z N + wN )

( z1 , z2 , , z N ) = ( z1 , z2 , , z N )
N

and it is easily checked that, with these operations,


We define an inner product on

by

< x, y > =

1
N

x y
k =1

is a (complex) vector space.

We say two vectors x and y are orthogonal if


< x, y > = 0 .
The length or norm of a vector x

is

| x|=

x, x .

A set of vectors in N is said to be orthogonal if whenever x and y are two different


vectors taken from the set, < x, y > = 0 . If, in addition, each vector in the set has length 1,
we say the set of vectors is orthonormal.
Lemma 1: The set of sampled signals sk , 0 k N 1 is an orthonormal basis for
N

Proof: Since there are N vectors in the set, and since an orthonormal set is automatically
linearly independent, it is enough to prove that the set is orthonormal.
First, we show that each sk is a unit vector.

sk , sk =

1 N 1 ik t j ik t j 1 N 1 ik t j 2 1 N 1
1
e e
= | e | = 1 = N = 1.

N j =0
N j =0
N j =0
N

Now we assume p q and both p and q are among 0,1,, N 1 and we show that
< s p , sq > = 0 .

We have
< s p , sq > =
Now

p tk =

1
N

2 p kL 2 pk
=
L N
N

so

i ptk iqtk =
Note that

so that

N 1

i p tk

iq tk

k =0

and

q t k =

2 i ( p q )k
.
N

N < p q < N

2 qk
N

2 i ( p q )
N

1.

Thus,
1
< s p , sq > =
N

N 1

i p tk

iq tk

k =0

1
=
N

N 1

2 i ( p q ) k
N

k =0

This last sum is a geometric sum with common ratio e

1
=
N

2 i ( p q )
N

2 i (Np q )
e
.

k =0

N 1

1 so the sum equals

2 i (Np q )
1 e

.
2 i ( p q )
1 e N
But the numerator is 0 because
N

2 i ( p q ) N
2 i (Np q )
N
e
=
e
= e 2 i ( p q ) = 1 .

Therefore, s p , sq = 0 , as asserted.
Theorem 1: Let x
s0 , s1 ,, sN 1 as

. Then x can be expressed in terms of the basis vectors


N 1

x = x , sk sk .
k =0

Proof: Since the vectors s0 , s1 ,, s N 1 are a basis for

complex numbers

, it follows that there exist

0 ,1 ,, N 1 such that

x = 0 s0 + 1s1 +

+ N 1sN 1 .

But then if we take the inner product of both sides with the vector sk , we get

x, sk = 0 s0 + 1s1 +

0 s0 , sk + 1 s1 , sk +
k sk , sk = k .
This proves the theorem.

+ N 1sN 1 , sk =
+ N 1 sN 1 , sk =

The Discrete Fourier Transform (DFT) and Inverse Transform (IDFT)


Definition: Given a discrete signal x
signal x defined by

, the Fourier Transform of x (DFT) is the

x = ( x0 , x1 ,, x N 1 ) where xk = x, sk .

Thus, to be explicit, the DFT of a signal x


component xk is given by

xk =

is a vector, denoted x , whose k-th

1 N 1 ik tn
xne
N n =0

Definition: Given a discrete signal x


is the signal x defined by

, the Inverse Fourier Transform of x (IDFT)


N 1

x = ( x0 , x1 ,, xN 1 ) where xk = xneitkn .
n =0

Theorem 2: The Inverse Fourier Transform is the inverse of the Fourier Transform. That
is, if x N , and X = x , then X = x.

Proof: The k-th component of X is X k =

N 1

X e
n =0

itk n

. But the sum on the right side of

the equation is just the k-th component of the vector


N 1

N 1

N 1

n =0

n =0

n=0

X n sn = xn sn = x, sn sn .
Thus, by Theorem 1,
N 1

X = x , sn s n = x ,
n =0

and the theorem is proved.


Example 1: Suppose x is a sampled signal of length N given by

xn = sin(

2 p
tn )
L

where p is an integer. Thus, the period of the signal is

L
p
so p complete periods fit into the interval [0, L]. One can show that:
If N = 2r , then:

x p =

1
1
, x N p =
, all other xk = 0 , except when p = 0 or p = r , in which case
2i
2i

x = 0 .

If N is odd, then:

x p =

1
1
, all other xk = 0 , except when p = 0 , in which case x = 0 .
, x N p =
2i
2i

For instance, here is the output for various p values for N=10.
p
p
p
p
p
p
p
p
p
p

=
=
=
=
=
=
=
=
=
=

0:
1:
2:
3:
4:
5:
6:
7:
8:
9:

{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,

0, 0, 0, 0, 0, 0, 0, 0, 0}
-0.5 I, 0, 0, 0, 0, 0, 0, 0, 0.5
0, -0.5 I, 0, 0, 0, 0, 0, 0.5 I,
0, 0, -0.5 I, 0, 0, 0, 0.5 I, 0,
0, 0, 0, -0.5 I, 0, 0.5 I, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0}
0, 0, 0, 0.5 I, 0, -0.5 I, 0, 0,
0, 0, 0.5 I, 0, 0, 0, -0.5 I, 0,
0, 0.5 I, 0, 0, 0, 0, 0, -0.5 I,
0.5 I, 0, 0, 0, 0, 0, 0, 0, -0.5

I}
0}
0}
0}
0}
0}
0}
I}

And here is the output for various p values for N=11


p
p
p
p
p
p
p
p
p
p
p

=
=
=
=
=
=
=
=
=
=
=

0:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:

{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,
{0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-0.5 I, 0, 0, 0, 0, 0, 0, 0, 0, 0.5
0, -0.5 I, 0, 0, 0, 0, 0, 0, 0.5 I,
0, 0, -0.5 I, 0, 0, 0, 0, 0.5 I, 0,
0, 0, 0, -0.5 I, 0, 0, 0.5 I, 0, 0,
0, 0, 0, 0, -0.5 I, 0.5 I, 0, 0, 0,
0, 0, 0, 0, 0.5 I, -0.5 I, 0, 0, 0,
0, 0, 0, 0.5 I, 0, 0, -0.5 I, 0, 0,
0, 0, 0.5 I, 0, 0, 0, 0, -0.5 I, 0,
0, 0.5 I, 0, 0, 0, 0, 0, 0, -0.5 I,
0.5 I, 0, 0, 0, 0, 0, 0, 0, 0, -0.5

I}
0}
0}
0}
0}
0}
0}
0}
0}
I}.

Transforming a Finite Data Sequence


Suppose x0 , x1 ,, xN 1 are numerical values. We can regard them as a sample of a
signal sampled at 0,1,, N 1 . Thus, we take T = 1 and hence L = N . Then we
have

tn = n and n =

2 n
.
N

The basis of complex exponentials that we constructed above now consists of


2 ik
2 ik 2
2 ik ( N 1)
2Nik 0

N
N
sk = e
= 1, e , e
, e N

for 0 k N 1 .

The definition of the inner product does not change. As before, we have the
representation of the sampled signal x in terms of the sk as
N 1

x = x , sk sk
k =0

so that
N 1

xn = x, sk e

2 ikn
N

k =0

where now
2 ikn

1 N 1
xk = x, sk = xn e N
N n =0