# OpenStax-CNX

You are here: Home » Content » The DFT: Frequency Doman with a Computer Analysis

### Recently Viewed

This feature requires Javascript to be enabled.

### Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

# The DFT: Frequency Doman with a Computer Analysis

Module by: Robert Nowak. E-mail the author

Summary: This module will take the ideas of samping CT signals farthur by examining how such operations can be performed in the frequency domain and by using a computer.

Note: You are viewing an old version of this document. The latest version is available here.

## Introduction

We just covered ideal (and non-ideal) (time) sampling of CT signals. This enabled DT signal processing solutions for CT applications (Figure 1):

Much of the theoretical analysis of such systems relied on frequency domain representations. How do we carry out these frequency domain analysis on the computer? Recall the following relationships: xn DTFT Xω x n DTFT X ω xt CTFT XΩ x t CTFT X Ω where ωω and ΩΩ are continuous frequency variables.

### Sampling DTFT

Consider the DTFT of a discrete-time (DT) signal xn x n . Assume xn x n is of finite duration N N (i.e., an NN-point signal).

Xω= n =0N1xne(i)ωn X ω n N 1 0 x n ω n
(1)
where Xω X ω is the continuous function that is indexed by the real-valued parameter πωπ ω . The other function, xn x n , is a discrete function that is indexed by integers.

We want to work with Xω X ω on a computer. Why not just sample Xω X ω ?

Xk=X2πNk= n =0N1xne(i)2πkNn X k X 2 N k n N 1 0 x n 2 k N n
(2)
In Equation 2 we sampled at ω=2πNk ω 2 N k where k=01N1 k 0 1 N 1 and Xk X k for k=0N1 k 0 N 1 is called the Discrete Fourier Transform (DFT) of xn x n .

#### Example 1

The DTFT of the image in Figure 2 is written as follows:

Xω= n =0N1xne(i)ωn X ω n N 1 0 x n ω n
(3)
where ωω is any 2π 2 -interval, for example πωπ ω .

where again we sampled at ω=2πNk ω 2 N k where k=01M1 k 0 1 M 1 . For example, we take M=10 M 10 . In the following section we will discuss in more detail how we should choose MM, the number of samples in the 2π 2 interval.

(This is precisely how we would plot Xω X ω in Matlab.)

#### Choosing M

##### Case 1

Given NN (length of xn x n ), choose MN M N to obtain a dense sampling of the DTFT (Figure 4):

##### Case 2

Choose MM as small as possible (to minimize the amount of computation).

In general, we require MN M N in order to represent all information in n ,n=0N1:xn n n 0 N 1 x n Let's concentrate on M=N M N : xn DFT Xk x n DFT X k for n=0N1 n 0 N 1 and k=0N1 k 0 N 1 numbers N  numbers numbersN  numbers

## Discrete Fourier Transform (DFT)

Define

XkX2πkN X k X 2 k N
(4)
where N=lengthxn N length x n and k=0N1 k 0 N 1 . In this case, M=N M N .

### DFT

Xk= n =0N1xne(i)2πkNn X k n N 1 0 x n 2 k N n
(5)

### Inverse DFT (IDFT)

xn=1N k =0N1Xkei2πkNn x n 1 N k N 1 0 X k 2 k N n
(6)

### Interpretation

Represent xn x n in terms of a sum of NN complex sinusoids of amplitudes Xk X k and frequencies k ,k0N1: ω k =2πkN k k 0 N 1 ω k 2 k N

#### Think:

Fourier Series with fundamental frequency 2πN 2 N

#### Remark 1

IDFT treats xn x n as though it were NN-periodic.

xn=1N k =0N1Xkei2πkNn x n 1 N k N 1 0 X k 2 k N n
(7)
where n0N1 n 0 N 1

##### Exercise 1

What about other values of nn?

###### Solution

xn+N=??? x n N ???

#### Remark 2

Proof that the IDFT inverts the DFT for n0N1 n 0 N 1

1N k =0N1Xkei2πkNn=1N k =0N1 m =0N1xme(i)2πkNmei2πkNn=??? 1 N k N 1 0 X k 2 k N n 1 N k N 1 0 m N 1 0 x m 2 k N m 2 k N n ???
(8)

### Example 2: Computing DFT

Given the following discrete-time signal (Figure 5) with N=4 N 4 , we will compute the DFT using two different methods (the DFT Formula and Sample DTFT):

1. DFT Formula
Xk= n =0N1xne(i)2πkNn=1+e(i)2πk4+e(i)2πk42+e(i)2πk43=1+e(i)π2k+e(i)πk+e(i)32πk X k n N 1 0 x n 2 k N n 1 2 k 4 2 k 4 2 2 k 4 3 1 2 k k 3 2 k
(9)
Using the above equation, we can solve and get the following results: x0=4 x 0 4 x1=0 x 1 0 x2=0 x 2 0 x3=0 x 3 0
2. Sample DTFT. Using the same figure, Figure 5, we will take the DTFT of the signal and get the following equations:
Xω=n=03e(i)ωn=1e(i)4ω1e(i)ω=??? X ω n 0 3 ω n 1 4 ω 1 ω ???
(10)
Our sample points will be: ω k =2πk4=π2k ω k 2 k 4 2 k where k=0123 k 0 1 2 3 (Figure 6).

## Periodicity of the DFT

DFT Xk X k consists of samples of DTFT, so Xω X ω , a 2π 2 -periodic DTFT signal, can be converted to Xk X k , an NN-periodic DFT.

Xk= n =0N1xne(i)2πkNn X k n N 1 0 x n 2 k N n
(11)
where e(i)2πkNn 2 k N n is an NN-periodic basis function (See Figure 7).

Also, recall,

xn=1N n =0N1Xkei2πkNn=1N n =0N1Xkei2πkN(n+mN)=??? x n 1 N n N 1 0 X k 2 k N n 1 N n N 1 0 X k 2 k N n m N ???
(12)

### Example 3: Illustration

#### note:

When we deal with the DFT, we need to remember that, in effect, this treats the signal as an NN-periodic sequence.

## A Sampling Perspective

Think of sampling the continuous function Xω X ω , as depicted in Figure 9. Sω S ω will represent the sampling function applied to Xω X ω and is illustrated in Figure 9 as well. This will result in our discrete-time sequence, Xk X k .

### Recall:

Remember the multiplication in the frequency domain is equal to convolution in the time domain!

### Inverse DTFT of S(ω)

k =δω2πkN k δ ω 2 k N
(13)
Given the above equation, we can take the DTFT and get the following equation:
N m =δnmNSn N m δ n m N S n
(14)

#### Exercise 2

Why does Equation 14 equal Sn S n ?

##### Solution

Sn S n is NN-periodic, so it has the following Fourier Series:

c k =1NN2N2δne(i)2πkNnd n =1N c k 1 N n N 2 N 2 δ n 2 k N n 1 N
(15)
Sn= k =e(i)2πkNn S n k 2 k N n
(16)
where the DTFT of the exponential in the above equation is equal to δω2πkN δ ω 2 k N .

So, in the time-domain we have (Figure 10):

## Connections

Combine signals in Figure 11 to get signals in Figure 12.

## Content actions

### Give feedback:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks