Connexions

Site Feedback

Discrete Time Fourier Series (DTFS)

By Michael Haag, Justin Romberg

Introduction

In this module, we will derive an expansion for discrete-time, periodic functions, and in doing so, derive the Discrete Time Fourier Series (DTFS), or the Discrete Fourier Transform (DFT).

DTFS

Eigenfunction analysis

Since complex exponentials are eigenfunctions of linear time-invariant (LTI) systems, calculating the output of an LTI system given eiωn ω n as an input amounts to simple multiplication, where ω 0 =2πkN ω 0 2 k N , and where HkC H k is the eigenvalue corresponding to k. As shown in the figure, a simple exponential input would yield the output

yn=Hkeiωn y n H k ω n
1

Figure 1: Simple LTI system.

Using this and the fact that is linear, calculating yn y n for combinations of complex exponentials is also straightforward.

c 1 ei ω 1 n+ c 2 ei ω 2 n c 1 H k 1 ei ω 1 n+ c 2 H k 2 ei ω 1 n c 1 ω 1 n c 2 ω 2 n c 1 H k 1 ω 1 n c 2 H k 2 ω 1 n l c l ei ω l nl c l H k l ei ω l n l c l ω l n l c l H k l ω l n

The action of HH on an input such as those in the two equations above is easy to explain. independently scales each exponential component ei ω l n ω l n by a different complex number H k l C H k l . As such, if we can write a function yn y n as a combination of complex exponentials it allows us to easily calculate the output of a system.

DTFS synthesis

It can be demonstrated that an arbitrary Discrete Time-periodic function fn f n can be written as a linear combination of harmonic complex sinusoids

fn= k =0N1 c k ei ω 0 kn f n k N 1 0 c k ω 0 k n
2
where ω 0 =2πN ω 0 2 N is the fundamental frequency. For almost all fn f n of practical interest, there exists c n c n to make Equation 2 true. If fn f n is finite energy ( fnL20N f n L 0 N 2 ), then the equality in Equation 2 holds in the sense of energy convergence; with discrete-time signals, there are no concerns for divergence as there are with continuous-time signals.

The c n c n - called the Fourier coefficients - tell us "how much" of the sinusoid ej ω 0 kn j ω 0 k n is in fn f n . The formula shows fn f n as a sum of complex exponentials, each of which is easily processed by an LTI system (since it is an eigenfunction of every LTI system). Mathematically, it tells us that the set of complex exponentials k ,kZ:ej ω 0 kn k k j ω 0 k n form a basis for the space of N-periodic discrete time functions.

DFT Synthesis Demonstration

Figure 2: Interact (when online) with a Mathematica CDF demonstrating Discrete Harmonic Sinusoids.

DTFS Analysis

Say we have the following set of numbers that describe a periodic, discrete-time signal, where N=4 N 4 : 32-213 3 2 -2 1 3 Such a periodic, discrete-time signal (with period NN) can be thought of as a finite set of numbers. For example, we can represent this signal as either a periodic signal or as just a single interval as follows:

(a) Periodic Function
(b) Function on the interval 0 T 0 T
Figure 3: Here we can look at just one period of the signal that has a vector length of four and is contained in C4 4 .

Note:
The cardinalsity of the set of discrete time signals with period NN equals CN N .
Here, we are going to form a basis using harmonic sinusoids. Before we look into this, it will be worth our time to look at the discrete-time, complex sinusoids in a little more detail.

Complex Sinusoids

If you are familiar with the basic sinusoid signal and with complex exponentials then you should not have any problem understanding this section. In most texts, you will see the the discrete-time, complex sinusoid noted as: eiωn ω n

Example 1
Figure 4: Complex sinusoid with frequency ω=0 ω 0
Example 2
Figure 5: Complex sinusoid with frequency ω=π4 ω 4

In the Complex Plane

The complex sinusoid can be directly mapped onto our complex plane, which allows us to easily visualize changes to the complex sinusoid and extract certain properties. The absolute value of our complex sinusoid has the following characteristic:

n ,nR:|eiωn|=1 n n ω n 1
3
which tells that our complex sinusoid only takes values on the unit circle. As for the angle, the following statement holds true:
eiωn=wn ω n w n
4
For more information, see the section on the Discrete Time Complex Exponential to learn about Aliasing , Negative Frequencies, and the formal definition of the Complex Conjugate .

Now that we have looked over the concepts of complex sinusoids, let us turn our attention back to finding a basis for discrete-time, periodic signals. After looking at all the complex sinusoids, we must answer the question of which discrete-time sinusoids do we need to represent periodic sequences with a period NN.

Equivalent Question:
Find a set of vectors n ,n=0N1: b k =ei ω k n n n 0 N 1 b k ω k n such that b k b k are a basis for n n
In answer to the above question, let us try the "harmonic" sinusoids with a fundamental frequency ω 0 =2πN ω 0 2 N :
Harmonic Sinusoid
ei2πNkn 2 N k n
5

(a) Harmonic sinusoid with k=0 k 0
(b) Imaginary part of sinusoid, ei2πN1n 2 N 1 n , with k=1 k 1
(c) Imaginary part of sinusoid, ei2πN2n 2 N 2 n , with k=2 k 2
Figure 6: Examples of our Harmonic Sinusoids

ei2πNkn 2 N k n is periodic with period N N and has kk "cycles" between n=0 n 0 and n=N1 n N 1 .

Theorem 1

If we let n ,n=0N1: b k n=1Nei2πNkn n n 0 N 1 b k n 1 N 2 N k n where the exponential term is a vector in CN N , then b k | k=0N1 k 0 N 1 b k is an orthonormal basis for CN N .

Proof

First of all, we must show b k b k is orthonormal, i.e. b k , b l = δ k l b k b l δ k l b k , b l = n =0N1 b k n b l n¯=1N n =0N1ei2πNkne(i2πNln) b k b l n N 1 0 b k n b l n 1 N n N 1 0 2 N k n 2 N l n

b k , b l =1N n =0N1ei2πN(lk)n b k b l 1 N n N 1 0 2 N l k n
6
If l=k l k , then
b k , b l =1N n =0N11=1 b k b l 1 N n N 1 0 1 1
7
If lk l k , then we must use the "partial summation formula" shown below: n =0N1αn= n =0αn n =Nαn=11ααN1α=1αN1α n N 1 0 α n n 0 α n n N α n 1 1 α α N 1 α 1 α N 1 α b k , b l =1N n =0N1ei2πN(lk)n b k b l 1 N n N 1 0 2 N l k n where in the above equation we can say that α=ei2πN(lk) α 2 N l k , and thus we can see how this is in the form needed to utilize our partial summation formula. b k , b l =1N1ei2πN(lk)N1ei2πN(lk)=1N111ei2πN(lk)=0 b k b l 1 N 1 2 N l k N 1 2 N l k 1 N 1 1 1 2 N l k 0 So,
b k , b l ={1  if  k=l0  if  kl b k b l 1 k l 0 k l
8
Therefore: b k b k is an orthonormal set. b k b k is also a basis, since there are NN vectors which are linearly independent (orthogonality implies linear independence).

And finally, we have shown that the harmonic sinusoids 1Nei2πNkn 1 N 2 N k n form an orthonormal basis for n n

Periodic Extension to DTFS

Now that we have an understanding of the discrete-time Fourier series (DTFS), we can consider the periodic extension of ck c k (the Discrete-time Fourier coefficients). Figure 7 shows a simple illustration of how we can represent a sequence as a periodic signal mapped over an infinite number of intervals.

(a) vectors
(b) periodic sequences
Figure 7
Exercise 1

Why does a periodic extension to the DTFS coefficients ck c k make sense?

Solution

Aliasing: b k =ei2πNkn b k 2 N k n

b k + N =ei2πN(k+N)n=ei2πNknei2πn=ei2πNn= b k b k + N 2 N k N n 2 N k n 2 n 2 N n b k
9
→ DTFS coefficients are also periodic with period NN.

Examples

Example 3: Discrete time square wave
Figure 8

Calculate the DTFS ck c k using:

ck=1Nn=0N1fne(i2πNkn) c k 1 N n 0 N 1 f n 2 N k n
10
Just like continuous time Fourier series, we can take the summation over any interval, so we have
c k =1Nn= N 1 N 1 e(i2πNkn) c k 1 N n N 1 N 1 2 N k n
11
Let m=n+ N 1 m n N 1 (so we can get a geometric series starting at 0)
c k =1Nm=02 N 1 e(i2πN(m N 1 )k)=1Nei2πNkm=02 N 1 e(i2πNmk) c k 1 N m 0 2 N 1 2 N m N 1 k 1 N 2 N k m 0 2 N 1 2 N m k
12
Now, using the "partial summation formula"
n=0Man=1aM+11a n 0 M a n 1 a M 1 1 a
13
c k =1Nei2πN N 1 km=02 N 1 e(i2πNk)m=1Nei2πN N 1 k1e(i2πN(2 N 1 +1))1e(ik2πN) c k 1 N 2 N N 1 k m 0 2 N 1 2 N k m 1 N 2 N N 1 k 1 2 N 2 N 1 1 1 k 2 N
14
Manipulate to make this look like a sinc function (distribute):
c k =1Ne(ik2π2N)(eik2πN( N 1 +12)e(ik2πN( N 1 +12)))e(ik2π2N)(eik2πN12e(ik2πN12))=1Nsin2πk( N 1 +12)NsinπkN= digital sinc c k 1 N k 2 2 N k 2 N N 1 1 2 k 2 N N 1 1 2 k 2 2 N k 2 N 1 2 k 2 N 1 2 1 N 2 k N 1 1 2 N k N digital sinc
15
Note:
It's periodic! Figure 9, Figure 10, and Figure 11show our above function and coefficients for various values of N 1 N 1 .

(a) Plot of fn f n .
(b) Plot of ck c k .
Figure 9: N 1 =1 N 1 1
(a) Plot of fn f n .
(b) Plot of ck c k .
Figure 10: N 1 =3 N 1 3
(a) Plot of fn f n .
(b) Plot of ck c k .
Figure 11: N 1 =7 N 1 7

DTFS conclusion

Using the steps shown above in the derivation and our previous understanding of Hilbert Spaces and Orthogonal Expansions, the rest of the derivation is automatic. Given a discrete-time, periodic signal (vector in n n ) fn f n , we can write:

fn=1N k =0N1 c k ei2πNkn f n 1 N k N 1 0 c k 2 N k n
16
c k =1N n =0N1fne(i2πNkn) c k 1 N n N 1 0 f n 2 N k n
17
Note: Most people collect both the 1N 1 N terms into the expression for c k c k .
Discrete Time Fourier Series:
Here is the common form of the DTFS with the above note taken into account: fn= k =0N1 c k ei2πNkn f n k N 1 0 c k 2 N k n c k =1N n =0N1fne(i2πNkn) c k 1 N n N 1 0 f n 2 N k n This is what the fft command in MATLAB does.