You are on page 1of 21

ECE-3205 DSP

CHAPTER-FOUR
DISCRETE TIME FOURIER TRANSFORM (DTFT) &
DISCRETE FOURIER TRANSFORM (DFT)

Discrete Time Fourier Transform (DTFT)


INTRODUCTION

The Fourier representation of signals plays an important role in both


continuous time and discrete-time signal processing.

It provides a method for mapping signals into another domain in which to


manipulate them.

This transform is useful to map the time-domain sequence into a continuous


function of a frequency variable ω.

Definition

ELECTRONIC & COMMUNICATION ENGINEERING Page 1


ECE-3205 DSP

TWO IMPORTANT PROPERTIES

(or)

X[n] X(ejω)

Real & Even Real & Even


Real & Odd Imaginary & Odd
Imaginary & Even Imaginary & Even
Imaginary & Odd Real & Odd

DTFT OF SOME COMMON SEQUENCES

SEQUENCE DTFT
𝛿[𝑛] 1
𝛿[𝑛 − 𝑛𝑜 ] −𝑗𝜔𝑛𝑜
𝑒
1 2𝜋𝛿(𝜔)
𝑒 𝑗𝑛𝜔𝑜 2𝜋𝛿(𝜔 − 𝜔0 )
𝑎𝑛 𝑢[𝑛], |𝑎| < 1 1
1 − 𝑎𝑒 −𝑗𝜔

ELECTRONIC & COMMUNICATION ENGINEERING Page 2


ECE-3205 DSP

−𝑎𝑛 𝑢[−𝑛 − 1], |𝑎| > 1 1


1 − 𝑎𝑒 −𝑗𝜔
cos⁡(𝑛𝜔𝑜 ) 𝜋𝛿 (𝜔 − 𝜔𝑜 ) + 𝜋𝛿 (𝜔 + 𝜔𝑜 )

Summary of DTFT Theorems & Properties


⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝐷𝑇𝐹𝑇⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡
Let 𝑥 (𝑛) ↔ 𝑋(𝑒 𝑗𝜔 )
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝐷𝑇𝐹𝑇⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡
𝑦(𝑛) ↔ 𝑌(𝑒 𝑗𝜔 )
PROPERTY SEQUENCE DTFT
Linearity 𝑎𝑥 (𝑛) + 𝑏𝑦(𝑛) aX(ejω ) + bY(ejω )
Time Shift 𝑥(𝑛 − 𝑛𝑜 ) e−jωno X(ejω )
Time –Reversal 𝑥(−𝑛) X(e−jω )
Modulation 𝑒 𝑗𝜔0 𝑛 𝑥(𝑛) X(ej(ω−ωo )
Convolution 𝑥(𝑛) ∗ 𝑦(𝑛) X(ejω ). Y(ejω )
Conjugation 𝑥 ∗ (𝑛) X ∗ (e−jω )
d
Derivative 𝑛𝑥(𝑛) j X(ejω )
π

1
Multiplication 𝑥 (𝑛)𝑦(𝑛) ∫ X(ejθ ) ∗ Y(e(jω−θ) )dθ

−π
Example:- If 𝑋(𝑒 ) = 𝜋𝛿(𝜔 − 𝜔𝑜 ) + 𝜋𝛿(𝜔 + 𝜔𝑜 ) Compute the inverse
𝑗𝜔

DTFT.
1 1
Sol:- 𝑥 (𝑛) = 𝑒 𝑗𝑛𝜔𝑜 + 𝑒 −𝑗𝑛𝜔𝑜 = ⁡cos⁡(𝑛𝜔𝑜 )
2 2

Relation between DTFT & DFT


DFT is same as DTFT, but it is defined only for finite duration sequences.The DFT is itself a
sequence rather than a function of continuous variable, and it corresponds to samples, equally spaced
in frequency of the DTFT of the signal.

ELECTRONIC & COMMUNICATION ENGINEERING Page 3


ECE-3205 DSP

Discrete Fourier Transform (DFT)


INTRODUCTION
The Discrete Fourier Transform (DFT) is a powerful computation tool which allows us to evaluate
the Fourier Transform 𝑋(𝑒 𝑗𝜔 ) on a digital computer or especially designed hardware.

DFT plays an important role in the implementation of many signal processing algorithms.

Definition
If 𝑥 (𝑛) = 0⁡𝑓𝑜𝑟⁡𝑛 < 0⁡𝑎𝑛𝑑⁡𝑛 ≥ 𝑁, then N point DFT is given by

--------------------- (1)
Then Inverse DFT is given by

--------------------- (2)

Let us define a term

which is known as a twiddle factor, and substituting in equations (1) & (2)

we get

----------------------------------- (3)

------------------------------ (4)

ELECTRONIC & COMMUNICATION ENGINEERING Page 4


ECE-3205 DSP

DFT using matrix method

If we
assume that the inverse of WN exists, then the above equation can be inverted by
premultiplying both sides by 𝑊𝑁−1 . Thus we obtain

------------------- ---- **

In fact, the IDFT as given by (**), can be expressed in matrix form as

ELECTRONIC & COMMUNICATION ENGINEERING Page 5


ECE-3205 DSP

EXAMPLE: Find the DFT of a sequence 𝑥(𝑛) = {1,1,0,0} and the IDFT of a
sequence 𝑌(𝑘) = {1,0,1,0}

Sol:-

ELECTRONIC & COMMUNICATION ENGINEERING Page 6


ECE-3205 DSP

ELECTRONIC & COMMUNICATION ENGINEERING Page 7


ECE-3205 DSP

Relationship of the DFT to other Transforms


1. The DFT and the Fourier Transform of x(n)
The Fourier Transform 𝑋(𝑒 𝑗𝜔 ) of a finite duration sequence 𝑥(𝑛) having length N is
given by
𝑁−1

𝑋(𝑒 𝑗𝜔 ) = ⁡ ∑ 𝑥(𝑛)𝑒 −𝑗𝜔𝑛


𝑛=0
---------------------- (5)

Where 𝑋(𝑒 𝑗𝜔 ) is a continuous function of ω.

The discrete Fourier Transform of 𝑥(𝑛) is given by

---------------- (6)

Comparing equations (5) & (6) we find that the DFT of 𝑥(𝑛) is a sampled version of
the Fourier Transform of the sequence and is given by

𝑋(𝑘) = ⁡⁡⁡⁡ 𝑋(𝑒 𝑗𝜔 )| 2𝜋𝑘 ⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑘 = 0,1,2, − − − − −, 𝑁 − 1.


𝜔=
𝑁

2. The DFT and the z-transform

ELECTRONIC & COMMUNICATION ENGINEERING Page 8


ECE-3205 DSP

We obtain the desired expression for 𝑥3 (𝑛)⁡in the form

ELECTRONIC & COMMUNICATION ENGINEERING Page 9


ECE-3205 DSP

------ (7)
The expression in the above equation has the form of a convolution sum. However it is not the
ordinary linear convolution, because the convolution sum involves the index ((𝑚 − 𝑛))𝑁 and is
called circular convolution. Thus we conclude that multiplications of the DFTs of two sequences are
equivalent to the circular convolution of two sequences in the time-domain.

Example 1

Solution: Each sequence consists of four nonzero points. For the purposes of illustrating the
operations involving in circular convolution, it is desirable to graph sequence as points on a circle.
We note that the sequences are graphed in a counter clockwise direction on a circle. This establishes
the reference direction in rotating one of the sequences relative to the other.

Now, 𝑥3 (𝑚) is obtained by circularly convolving 𝑥1 (𝑛)⁡𝑎𝑛𝑑⁡𝑥2 (𝑛) as specified by equation (7).

Beginning with m=0 we have


3

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (0) = ⁡ ∑ 𝑥1 (𝑛)𝑥2 ((−𝑛))𝑁


𝑛=0

𝑥2 ((−𝑛))4 is simply the sequence 𝑥2 (𝑛) folded and graphed on a circle as illustrated in fig. 3.1b. In
other words, the folded sequence is simply 𝑥2 (𝑛) graphed in a clockwise direction.

ELECTRONIC & COMMUNICATION ENGINEERING Page 10


ECE-3205 DSP

The product sequence is obtained by multiplying 𝑥1 (𝑛) with 𝑥2 ((−𝑛))4 , point by point. The
sequence is also illustrated in fig. 3.1b. Finally, we sum the values in the product sequence to obtain

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (0) = 14

For m=1 we have


3

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (1) = ⁡ ∑ 𝑥1 (𝑛)𝑥2 ((1 − 𝑛))4


𝑛=0

It is easily verified that 𝑥2 ((1 − 𝑛))4 is simply the sequence 𝑥2 ((−𝑛))4 rotated counter clockwise by
one unit in time as illustrated in fig 3.1c. This rotated sequence multiplies 𝑥1 (𝑛) to yield the product
sequence, also illustrated in fig. 3.1c. Finally, we sum the values in the product sequence to obtain
𝑥3 (1). Thus

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (1) = 16

For m=2 we have


3

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (2) = ⁡ ∑ 𝑥1 (𝑛)𝑥2 ((2 − 𝑛))4


𝑛=0

Now 𝑥2 ((2 − 𝑛))4 is the folded sequence in fig.3.1b rotated two units of time in the counter
clockwise direction. The resultant sequence is illustrated in fig 3.1d along with the product sequence
𝑥1 (𝑛)𝑥2 ((2 − 𝑛))4. By summing the four terms in the product sequence, we obtain

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (2) = 14

For m= 3 we have
3

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (3) = ⁡ ∑ 𝑥1 (𝑛)𝑥2 ((3 − 𝑛))4


𝑛=0

The folded sequence 𝑥2 ((−𝑛))4 is now rotated by three units in time to yield 𝑥2 ((3 − 𝑛))4 and the
resultant sequence is multiplied by 𝑥1 (𝑛) to yield the product sequence as illustrated in fig. 3.1e. The
sum of the values in the product sequence is

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (3) = 16

We observe that if the computation above is continued beyond m=3, we simply repeat the sequence
of four values obtained above. Therefore, the circular convolution of the two sequences 𝑥1 (𝑛) and
𝑥2 (𝑛) yields the sequence

⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥3 (𝑛) = {14, 16, 14, 16}

ELECTRONIC & COMMUNICATION ENGINEERING Page 11


ECE-3205 DSP

Figure 3.1

ELECTRONIC & COMMUNICATION ENGINEERING Page 12


ECE-3205 DSP

Circular Convolution Using Matrix Method


If 𝑦(𝑛) = 𝑥(𝑛)⨂ℎ(𝑛), Using matrix approach we can write h(n) as N*N matrix form and x(n) as
column matrix.

Note that each row of the matrix in the above equation is a circular right-shift of the previous
row.

EFFICIENT COMPUTATION OF THE DFT : FAST


FOURIER TRANSFORM
INTRODUCTION
Fast Fourier transform (FFT) is a numerical algorithm that has been developed to improve the
computational efficiency by an enormous amount and is the most popular method used in spectral
analysis in digital signal processing, specifically, to find the DFT of the signal and also the inverse
DFT of the frequency response to get the discrete-time signal. This is only a computational algorithm
and not another transform.
In this FFT algorithm, when the value for the radix N is chosen as 2R, where R is a positive integer
(index of stage), the number of complex multiplications is of the order (N/2) log2(N) and the number
of complex additions is of the order N log2 N.
The basic strategy that is used in the FFT algorithm is one of "divide and conquer." which involves
decomposing an N-point DFT into successively smaller DFTs.
Recall the definition of DFT:

DFT:

IDFT:

Where,

ELECTRONIC & COMMUNICATION ENGINEERING Page 13


ECE-3205 DSP

RADIX-2 FFT ALGORITHMS


1. Decimation-in-Time FFT
The decimation-in-time FFT algorithm is based on splitting (decimating) x(n) into smaller sequences
and finding X(k) from the DFTs of these decimated sequences. This section describes how this
decimation leads to an efficient algorithm when the sequence length is a power of 2.
Let x(n) be a sequence of length N = 2R, and suppose that x(n) is split (decimated) into two sub
sequences, each of length N/2.

Separating x(n) into its even-and odd-numbered points.

𝑁
Substitution of n = 2r for n even and n = 2r+1 for n odd, where r=0, 1,- - -, −1
2

Consequently, the above equation can be rewritten as

𝑁 𝑁
−1 −1
Where, 𝐺(𝑘) = ⁡ ∑𝑛=0 𝑔[𝑛] ⁡𝑊𝑁 ⁡𝑎𝑛𝑑⁡⁡⁡⁡𝐻(𝐾) = ⁡ ∑𝑛=0 ℎ[𝑛] ⁡𝑊𝑁𝑘𝑛 ⁡
2 𝑘𝑛 2

2 2
𝑁
𝑔[𝑛] = 𝑥[2𝑛]⁡𝑎𝑛𝑑⁡ℎ[𝑛] = 𝑥[2𝑛 + 1], 𝑛 = 0, 1, − − − − 1
2
𝑋(𝑘) = 𝐺(𝑘) + ⁡ 𝑊𝑁𝑘 𝐻(𝑘)
𝑁
𝑁 𝑘+
𝑋 (𝑘 + ) =⁡𝐺(𝑘) + ⁡ 𝑊𝑁 2
𝐻(𝑘)
2
𝑁 𝑗2𝜋 𝑁 𝑗2𝜋 𝑗2𝜋
𝑘+
𝑊𝑁 2 = ⁡ 𝑒−𝑁
(𝑘+ )
2 = ⁡ 𝑒− 𝑘
𝑁 . 𝑒 −𝑗2𝜋 = ⁡ −𝑒 −𝑁
𝑘
= ⁡ −𝑊𝑁𝑘

ELECTRONIC & COMMUNICATION ENGINEERING Page 14


ECE-3205 DSP

𝑁
𝑋 (𝑘 + ) =⁡𝐺(𝑘) − ⁡ 𝑊𝑁𝑘 𝐻(𝑘)
2
Properties of 𝑊𝑁 :
𝑁
𝑘+
Symmetry property: 𝑊𝑁 = ⁡ −𝑊𝑁𝑘 2

Periodicity >> : 𝑊𝑁𝑘+𝑁 = ⁡ 𝑊𝑁𝑘



Recursion >> : 𝑊𝑁2 = ⁡ 𝑊𝑁/2

Computation of N = 8 point DFT

Below figure depicts the Computation of N = 8 point DFT. We observe that computation is
performed in three stages, beginning with the computations of four two-point DFTs, then two four-
point DFTs and finally one eight-point DFT.
The combination of the smaller DFTs to form the larger DFT is illustrated in figure for N=8.

The below figure shows the basic butterfly computation in the decimation-in-time FFT algorithm.

The basic computation is performed at every stage as illustrated in the below figure.

ELECTRONIC & COMMUNICATION ENGINEERING Page 15


ECE-3205 DSP

BUTTERFLY DIAGRAM

2. Decimation-in-Frequency FFT: It is based on decimating (splitting) the output


sequence X(k) into smaller and smaller subsequence’s.

Computation of N = 8 point DFT

Below figure depicts the Computation of N = 8 point DFT. We observe that computation is
performed in three stages, beginning with the computation of one eight-point DFT, then two four-
point DFTs and finally four two-point DFTs.

BUTTERFLY DIAGRAM

ELECTRONIC & COMMUNICATION ENGINEERING Page 16


ECE-3205 DSP

NOTE:
In case of DIT-FFT algorithm, output sequence is in order and input sequence is in bit-reversal order.
In case of DIF-FFT algorithm, input sequence is in order and output sequence is in bit-reversal order.
Generally the twiddle factor ⁡𝑖𝑠⁡𝑊𝑁𝑘 for both DIT and DIF algorithms, where k value is given by
𝑁𝑡⁡
𝑊𝑁𝑘 , 𝐾= 𝑅
⁡; 𝑡 = 0,1,2, − − − − −, (2𝑟−1 − 1).
2
R is the index of stage (R=1 for stage 1, R=2 for stage 2,R=3 for stage 3 and so on).

Standard values of twiddle factors are given below

ELECTRONIC & COMMUNICATION ENGINEERING Page 17


ECE-3205 DSP

𝑾𝟎𝟒 = 𝟏; 𝑾𝟏𝟒 = −𝒋; 𝑾𝟎𝟖 = 𝟏; 𝑾𝟏𝟖 = 𝟎. 𝟕𝟎𝟕 − 𝒋𝟎. 𝟕𝟎𝟕; 𝑾𝟐𝟖 = −𝒋; 𝑾𝟑𝟖 = −𝟎. 𝟕𝟎𝟕 − 𝒋𝟎. 𝟕𝟎𝟕

EXAMPLE
Compute the DFT of a sequence 𝒙(𝒏) = {𝟏, −𝟏, 𝟏, −𝟏} using DIT algorithm.
Sol:- Let 𝒙(𝑛) = {1, −1,1, −1} ; Length N=4.
Twiddle factors are 𝑾𝟎𝟒 = 𝟏; 𝑾𝟏𝟒 = −𝒋;
Butterfly diagram

The output sequence 𝑋(𝑘) = {0,0,4,0}

EXAMPLE
Compute the DFT of a sequence 𝑥(𝑛) = {0,1,2,3} using DIT and DIF algorithms.
Sol:- Let 𝒙(𝑛) = {0,1,2,3} ; Length N=4.
Twiddle factors are 𝑾𝟎𝟒 = 𝟏; 𝑾𝟏𝟒 = −𝒋;

DIT Butterfly Diagram

ELECTRONIC & COMMUNICATION ENGINEERING Page 18


ECE-3205 DSP

EXAMPLE
Compute the DFT of a sequence 𝑥(𝑛) = {1,1,1,1,1,1,1,1} using DIT and DIF
algorithms.
Sol:- Let 𝒙(𝑛) = {1,1,1,1,1,1,1,1} ; Length N=8
Twiddle factors are
𝑊80 = 1; 𝑊81 = 0.707 − 𝑗0.707; 𝑊82 = −𝑗; 𝑊83 = −0.707 − 𝑗0.707

DIT Butterfly Diagram

ELECTRONIC & COMMUNICATION ENGINEERING Page 19


ECE-3205 DSP

DIF Butterfly Diagram

IDFT Using FFT Algorithms


FFT algorithms can be used to compute an inverse DFT without any change in the algorithm.
The inverse DFT of an N-point sequence

where .
Taking complex conjugate and multiply by N, we obtain,
𝑁−1

𝑁𝑥 ∗ (𝑛) = ∑ 𝑋 ∗ (𝑘)𝑊𝑁𝑘𝑛
𝑘=0

The right hand side of the equation is DFT of the sequence 𝑋 ∗ (𝑘) and may be computed using any
FFT algorithm.
The desired output sequence x(n) can then be found by complex conjugating the DFT and dividing by
N to give

ELECTRONIC & COMMUNICATION ENGINEERING Page 20


ECE-3205 DSP

𝑁−1 ∗
1
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑥(𝑛) = [∑ 𝑋 ∗ (𝑘)𝑊𝑁𝑘𝑛 ]
𝑁
𝑘=0

Example
Find the IDFT of the sequence 𝑋(𝑘 ) = {10, −2 + 2𝑗, −2, −2 − 2𝑗} using DIT & DIF
algorithms.

Sol: - Let ⁡𝑋(𝑘) = {10, −2 + 2𝑗, −2, −2 − 2𝑗} ; N=4; 𝑊40 = 1; 𝑊41 = −𝑗;

𝑁𝑥 ∗ (𝑛) = {4,8,12,16}⁡⁡𝑎𝑛𝑑⁡⁡𝑥(𝑛) = {1,2,3,4}

Try DIF algorithm, you get the same answer.

ELECTRONIC & COMMUNICATION ENGINEERING Page 21

You might also like