0% found this document useful (0 votes)
13 views45 pages

Chapter 2 Part 2

Chapter 2 discusses the Discrete Fourier Transform (DFT), its definition, computation methods, and properties, including energy and power spectrum calculations. It also covers the Fast Fourier Transform (FFT) as an efficient algorithm for computing DFT, emphasizing the computational complexity involved. Various examples illustrate the application of DFT and the differences between linear and circular convolution.

Uploaded by

Jeyasanthini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views45 pages

Chapter 2 Part 2

Chapter 2 discusses the Discrete Fourier Transform (DFT), its definition, computation methods, and properties, including energy and power spectrum calculations. It also covers the Fast Fourier Transform (FFT) as an efficient algorithm for computing DFT, emphasizing the computational complexity involved. Various examples illustrate the application of DFT and the differences between linear and circular convolution.

Uploaded by

Jeyasanthini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 45

Chapter 2: Discrete Fourier Transform (DFT)

Redzuan Abdul Manap


April 2025
Chapter Outline
2.1 Introduction
2.2 Types of Fourier Transform
2.3 Discrete-time Fourier Transform (DTFT)
2.4 Discrete Fourier Transform (DFT)
2.5 Fast Fourier Transform (FFT)

2
2.4 DFT – Definition and Equations
• The simplest relation between an N-length sequence , defined for
and its DTFT is obtained by uniformly sampling on the -axis at

• I.e. DFT is defined as:


(2.6)

3
2.4 DFT – Definition and Equations
• DFT: (2.6)

Let , then

(2.7)

• Inverse DFT:

(2.8)

4
2.4 DFT – Definition and Equations

5
2.4 DFT - Energy and power spectrum
• The energy of the spectrum
2
E xx (k )  X (k )

• The power of the spectrum


1 2
Pxx (k )  X (k )
N

6
2.4 DFT - Computation

– For any given k, the DFT is computed by


multiplying each with each of the complex
exponentials and then adding up all these
components.
– For example, we wish to compute an 8-point DFT
(i.e. N=8), the complex exponentials are 8 unit
vectors placed at equal distances from each other
on the unit circle.

7
2.4 DFT - Computation

8
2.4 DFT – Twiddle factor
2.4 DFT – Example 1
• Find the twiddle factors for an eight-point DFT
2.4 DFT – Example 2
Find DFT of the sequence x[n]={1,0,1,0}
2.4 DFT – Example 3
Find DFT of the sequence x(n)={1,2,1,1}
Solution:
Step 1: Find a twiddle factor of 4 point DFT
x(n) x(n)

n=0 n=1 n=2 n=3 n=0 n=1 n=2 n=3

k=0 k=0 1 1 1 1

k=1 k=1 1 -j -1 j
X(k) X(k)
k=2 k=2 1 -1 1 -1

k=3 k=3 1 j -1 -j
2.4 DFT – Example 3


2.4 DFT – Example 4
A finite duration sequence with a length of eight has a DFT of as shown
below.

A new sequence of length 16 is defined by:

Sketch the DFT as a function of


2.4 DFT – Example 4
Solution:

Since , we can rewrite this as


2.4 DFT – Example 4

• This means that the 16-point DFT should contain two copies of the 8-
point DFT of and has a period of 8. The DFT as a function of is shown
below:
2.4 DFT – Example 5
A discrete frequency representation of a sample size of 16 are
given as below
X ( k ) 16 k 0
8 k 1
8 k 15
0 elsewhere

Determine the discrete-time signal equation of this frequency


representation.

17
2.4 DFT – Example 5
By applying the inverse equation, the discrete-time representation is:

Expanding the equation

Since

18
2.4 DFT – Basic properties

19
2.4 DFT – Linear convolution (revisit)
 Linear convolution between two N-length sequences, and results in a (2N-1)-
length sequence, :

 Linear convolution is commutative:

20
2.4 DFT – Circular convolution
• To develop a convolution-like operation resulting in a N-length
sequence , we need to define a circular time-reversal and then
apply a circular time-shift.
• The resulting operation is called circular convolution.
• Let represent the circular convolution of the sequences and , then
is given as:

(2.9)

• Like linear convolution, circular convolution is also commutative.

21
2.4 DFT – Example 6
Perform linear and circular convolution between
g[n] = [1 2 0 1] and h[n] = [2 2 1 1].

Linear convolution :
[1 2 0 1] [1 2 0 1] [1 2 0 1] [1 2 0 1]
[1 1 2 2] [1 1 2 2] [1 1 2 2] [1 1 2 2]
[2 0 0 0] 2 [2 4 0 0] 6 [1 4 0 0]5 [1 2 0 2] 5

[1 2 0 1] [1 2 0 1] [1 2 0 1]
[1 1 2 2] [1 1 2 2] [1 1 2 2]
[0 2 0 2] 4 [0 0 0 1] 1 [0 0 0 1] 1

22
2.4 DFT – Example 6 𝑁 −1
Circular convolution : 𝑦 𝑐 [ 𝑛 ] = ∑ 𝑔 [ 𝑚 ] h [ ⟨ 𝑛− 𝑚 ⟩ 𝑁 ]
𝑚=0
g[n] = [1 2 0 1] and h[n] = [2 2 1 1].

[1 2 0 1] [1 2 0 1] [1 2 0 1] [1 2 0 1]
[ 2 1 1 2 ] h[1-m4] [ 2 2 1 1 ] h[2-m4] [ 1 2 2 1 ] h[3-m4] [ 1 1 2 2 ] h[-m4]

[2 2 0 2] 6 [2 4 0 1] 7 [1 4 0 1] 6 [1 2 0 2] 5

Why the answer is We need to apply zero padding to it before applying a circular
not similar? convolution

23
2.4 DFT – Example 6
Extend the sequence g[n] and h[n] to length 7 as follows:

[1 2 0 1 0 0 0] [1 2 0 1 0 0 0]
[2 0 0 0 1 1 2] he[1-m7] [2 2 0 0 0 1 1] he[2-m7]
[2 0 0 0 0 0 0] 2 [2 4 0 0 0 0 0] 6

[1 2 0 1 0 0 0] [1 2 0 1 0 0 0]
[1 2 2 0 0 0 1] he[3-m7] [ 1 1 2 2 0 0 0 ] he[4-m7]
[1 4 0 0 0 0 0] 5 [1 2 0 2 0 0 0] 5

24
2.4 DFT – Example 6
[1 2 0 1 0 0 0] [1 2 0 1 0 0 0]
[0 1 1 2 2 0 0] he [5-m7] [0 0 1 1 2 2 0] he[6-m7]
[0 2 0 2 0 0 0] 4 [0 0 0 1 0 0 0] 1

[1 2 0 1 0 0 0]
[ 0 0 0 1 1 2 2 ] he[-m7]
[0 0 0 1 0 0 0] 1

The result is the same as the linear convolution!

25
2.4 DFT – Example 7

h(n)
x(n).h(n)
2 2 1 1
1 2 2 1 1
2 4 4 2 2
x(n) 3 6 6 3 3
0 0 0 0 0
1 2 2 1 1
2.4 DFT – Example 7

h(n)
x(n).h(n)
2 2 1 1

1 2 2 1 1

2 4 4 2 2

x(n) 3 6 6 3 3

0 0 0 0 0

1 2 2 1 1
2.4 DFT – Example 7
2.4 DFT – Exercise (ULearn)

29
2.4 DFT – Linear vs Circular convolution
 Note that the results of linear and circular convolution are different.
 For starters, they are not even of equal length: For two sequences of
length N and M, the linear convolution is of length N+M-1, whereas its
circular convolution is of length max(N, M), where the shorter sequence
is zero padded to make it the same length as the longer one.
 All LTI systems are based on the principle of linear convolution, as the
output of an LTI system is the linear convolution of the system impulse
response and the input to the system, which is equivalent to the
product of the respective DTFTs in the frequency domain.
 DTFT is based on linear convolution whereas DFT is based on circular
convolution.
30
2.4 DFT – Linear vs Circular convolution
 Is there any relationship between the linear and circular convolutions?
Yes!
 Fact: if we zero pad both sequences x[n] and h[n], so that they are both
of length N+M-1, then linear convolution and circular convolution result
in identical sequences.
 The inverse DFT of X(k)•H(k) is the circular convolution of x[n] and h[n].
If they are zero padded, then the inverse DFT is the linear convolution
of the two.
 I.e. if the respective DFTs of the zero padded sequences are X(k) and
H(k), then the inverse DFT of X(k)•H(k) is equal to the linear convolution
of x[n] and h[n].
31
2.4 DFT - Computing Convolution using DFT
• We can compute the convolution using the inverse DFT of X(k)•H(k)
since it is equal to the linear convolution of x[n] and h[n].
• It is often more computationally efficient to compute the DFTs of X(k)
and H(k), multiply them, and take the inverse DFT than to compute
the convolution in time domain:
• However, the IDFT gives the circular convolution. To ensure that one
gets linear convolution, both sequences in the time domain must be
zero padded to appropriate length.

32
2.4 DFT – Example 8

x[n]

n=0 n=1 n=2 n=3

k=0 1 1 1 1

k=1 1 -j -1 j
X(k)
k=2 1 -1 1 -1

k=3 1 j -1 -j
2.4 DFT – Example 8
x(n)

n=0 n=1 n=2 n=3

k=0 1 1 1 1

k=1 1 j -1 -j
X(k)
k=2 1 -1 1 -1

k=3 1 -j -1 j

Compare your answer with Example 6:


circular convolution without zero
padding
2.4 DFT – MATLAB example
Compute linear convolution of x[n]=[1 3 2 -1 4], h[n]=[2 0 1 7 -3] by
appropriate zero padding the two.
x=[1 3 2 -1 4];
h=[2 0 1 7 -3];
x2=[1 3 2 -1 4 0 0 0 0];
h2=[2 0 1 7 -3 0 0 0 0];
c1=conv(x,h);
X=fft(x2); H=fft(h2);
c2=ifft(X.*H);
subplot(411)
stem(x,'filled');grid
subplot(412)
stem(h,'filled');grid
subplot(413)
stem(c1,'filled');grid
subplot(414)
stem(real(c2),'filled');grid

35
2.5 Fast Fourier Transform (FFT)
 DFT plays an important role in analysis, design and implementation
of discrete-time signal processing algorithms and systems.
 One major problem with the DFT is its extremely high
computational requirement, thus it is important to have an
efficient algorithm to compute DFT.
 A number of algorithms have been developed for that purpose and
they are collectively known as Fast Fourier Transform (FFT)
algorithms.
 There are many ways to measure the complexity and efficiency of
an implementation or algorithm.

36
2.5 Fast Fourier Transform (FFT)
 We normally use the number of arithmetic multiplications and
additions as a measure of computational complexity.
 In terms of multiplications and additions, FFT algorithms can be of
orders of magnitude more efficient than competing algorithms.
 The efficiency of FFT is so high that in many cases the most
efficient way of implementing convolution is by the transforming
the sequences involved, multiplying the transform results and
inverse-transforming the product back to time-domain.

37
2.5 Fast Fourier Transform (FFT)
Recall that the DFT of a finite-length sequence of length N is
defined as

• For each value of , we require complex multiplications and complex


additions.
• A total of complex multiplications and complex additions for all values of .
• Similar complexity also applies for computing the inverse DFT

38
2.5 Fast Fourier Transform (FFT)
 I.e. the amount of computation and the corresponding
computation time for DFT is proportional to N2.
 The number of arithmetic operations required becomes very large
for large values of N, e.g., if N = 1000, one million arithmetic
operations are required!
 One way to improve the efficiency of DFT computation is to exploit
the symmetry and periodicity properties of :

W Nk  N / 2 W NkW NN / 2  W Nk (symmetry property)


W Nkn W Nk n  N  W Nk  N n (periodici ty in n and k )
WN e  j 2 N

39
2.5 Fast Fourier Transform (FFT)
 By taking these two properties as the twiddle factor, it is possible
to reduce the number of operations to approximately Nlog2N.
 Algorithms that do this are called Fast Fourier Transforms (FFT).
 FFT algorithms are based on the fundamental principle of
decomposing the computation of DFT of a length-N sequence into
successively smaller DFTs.
 Initially, an N-point DFT can be decomposed into two (N/2)-point
DFTs.
 Each (N/2)-point DFT can be further decomposed into two (N/4)-
point DFTs, and so on, until a set of (N/2) 2-point DFTs is
obtained.
40
2.5 FFT - Mathematics
 Break a signal of N samples into two subsequences with N/2
samples (decimation in time)
 One sequence contains samples with even-numbered values of
n, the other contains those with odd-numbered values of n.
 Writing n(even) = 2m and n(odd) = 2m +1, we have DFT of:

41
2.5 FFT - Mathematics

 Given , the DFT can be rewritten as two N/2 point DFTs:

(2.10)

is the DFT of the even-numbered points in


is the DFT of the odd-numbered points in

42
2.5 FFT - Mathematics
 Computation of Eq. (2.10) is generally broken down into N/2 so called
“butterfly operations”
 Example: N = 8, and we consider the case of k = 1 and k = N/2 +1 = 5:

using symmetry property


is the DFT of and is the DFT of
Signal flow diagram in this case:

43
2.5 FFT - Mathematics
 Time decimated FFT, N = 8

44
2.5 FFT - MATLAB
n=0:31; k=0:31 ;
x=0.9. "n;
w=linspace(0, 2*pi, 512);
k=linspace(0, 2"pi, 32);
X1 =1 ./(1-0.9*exp(-j*w));
X2=(1-(0.9*exp(-j*(2*pi/32)*k)). "32)./
(1-0.9*exp(-t(2"pi/32)*k));
X=fft(x);
subplot(311)
plot(w, abs(X1 )); grid
subplot(312)
stem(k, abs(X2), 'r', 'filled'); grid
subplot(313)
stem(k, abs(X), 'g', 'filled'); grid

Findings: (1) DFT is indeed the sampled version of DTFT and (2) DFT and
FFT produce identical results
45

You might also like