0% found this document useful (0 votes)
110 views69 pages

Chapter-5 - Disrete Fourier Transform

The document discusses the discrete Fourier transform (DFT). It begins with an introduction to DFT, explaining how the continuous exponential function of the discrete-time Fourier transform (DTFT) is sampled to become discrete. This results in the definition of the DFT and inverse DFT (IDFT). Examples are provided to demonstrate calculating the DFT of sequences. The relationship between the DFT and z-transform is also mentioned. Finally, the document discusses representing the DFT and IDFT using a matrix formulation, with an example provided.

Uploaded by

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

Chapter-5 - Disrete Fourier Transform

The document discusses the discrete Fourier transform (DFT). It begins with an introduction to DFT, explaining how the continuous exponential function of the discrete-time Fourier transform (DTFT) is sampled to become discrete. This results in the definition of the DFT and inverse DFT (IDFT). Examples are provided to demonstrate calculating the DFT of sequences. The relationship between the DFT and z-transform is also mentioned. Finally, the document discusses representing the DFT and IDFT using a matrix formulation, with an example provided.

Uploaded by

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

BEE4413

DIGITAL SIGNAL PROCESSING

Topic 7

Discrete Fourier
Transform (DFT)
Subtopics

7.0 Discrete Fourier Transform (DFT) (6 Hours)


7.1 Introduction to DFT
7.2 Properties and Relationship to z-Transform
7.3 Inverse Discrete Fourier Transform (IDFT)
7.4 Fast Fourier Transform (FFT)
7.5 Inverse Fast Fourier Transform (IFFT)
7.6 Convolution using DFT technique

(BT Level 3: Applying)


Rearrange Subtopis

7.0 Discrete Fourier Transform (DFT) (6 Hours)


7.1 Introduction to DFT
7.2 Properties and Relationship to z-Transform
7.3 Inverse Discrete Fourier Transform (IDFT)
7.4 Fast Fourier Transform (FFT) and Inverse
Fast Fourier Transform (IFFT)
7.5 Convolution using DFT technique
7.1

INTRODUCTION TO DFT
Frequency Domain Sampling

 Frequency analysis has been studied in


Topic 4 where the frequency response of a
discrete LTI system were examine
j
 Recall DTFT: x(n)  X ( )  X (e )
 Exponential is a continuous function
 As for that, the exponential function needs to
be sampled to become discrete
Frequency Domain Sampling

 Since X(ω) is periodic with period 2π, only


samples in fundamental frequency range are
necessary
 As for that, the frequency ω from 0 to 2π can
be sampled by N samples
2k

N
where k is the variable for each sample
Frequency Domain Sampling

 If x(n) is a finite sequence that also has been


sample by N, the DTFT equation now has
becomes DFT:
 N -1 2kn
-j
- jn
X ( )   x ( n )e
n  -
 X ( k )   x ( n )e
n 0
N

 And the inverse of DFT is called IDFT:


N -1 2kn
1 j
x ( n) 
N
 X ( k )e
k 0
N
Example 1

 Let x(n) = {1,2,1,0}. Obtain X(k) by


transforming x(n) using DFT
Solution to Example 1

 The DFT equation is:


N -1 2kn
-j
X ( k )   x ( n )e N

n 0
 N = 4, as the sequence have 4 samples
 X(k) becomes:
4 -1 2kn 3 - jkn
-j
X ( k )   x ( n )e 4
  x ( n )e 2

n 0 n 0
Solution to Example 1

 The results:
3 - j ( 0 ) n 3
X (0)   x(n)e 2
  x ( n)  1  2  1  0  4
n 0 n0
3 - j (1) n 3 - jn - j
X (1)   x(n)e 2
  x ( n)e 2
 1  2e 2
 e - j  0
n 0 n 0

  
 1  2 cos - j sin   cos  - j sin    1  2- j  - 1  - j 2
 2 2
3 - j ( 2 ) n 3
X (2)   x(n)e 2
  x(n)e - jn  1  2e - j  e - j 2  0
n 0 n 0

 1  2cos  - j sin    cos 2 - j sin 2   1  2- 1  1  0


3 - j ( 3) n 3 - j 3 n - j 3
X (3)   x(n)e 2
  x ( n)e 2
 1  2e 2
 e - j 3  0
n 0 n 0

 3 3 
 1  2 cos - j sin   cos 3 - j sin 3   1  2 j   - 1  j 2
 2 2 
Solution to Example 1

 X (k )  {4,- j 2,0, j 2}
Example 2

 Find the 10-point DFT of each of the


following sequence:
a) x(n)   (n)   (n - 5)
b) x(n)  u (n) - u (n - 6)
Solution to Example 2(a)

 The sequence can also be written as:


x(n)  1,0,0,0,0,1
 The DFT required a 10-point sample, the
sequence should be written as:
x(n)  1,0,0,0,0,1,0,0,0,0
 As for that, the DFT for the sequence can be
written as (in variable of k):
N -1 2kn 9 kn
-j -j
X ( k )   x ( n )e N
  x ( n)e 5
 1  e - jk
n 0 n 0
Solution to Example 2(b)

 The sequence can also be written as:


x(n)  {1,1,1,1,1,1,0,0,0,0}
 The 10-point DFT is defined as:
9 kn
-j
X ( k )   x ( n )e 5

n 0

 By examining the sequence, there will only


be result for n = 0 until n= 5, as n ≥ 6 will
result in 0
Solution to Example 2(b)

 Hence, the DFT can be simplified as:


k 6
 -j 5 
kn k n 1 -  e  -j
 1- e 5
6k
5 -j 6 -1  -j 5 
X (k )   e 5
   e 
   k   k
n 0 n 0    -j 5  - j
1 -  e  1- e 5

 
Matrix Formulation of DFT
- j 2 N
 W
By substituting N  e , the definition of
DFT and IDFT can be written as:
N -1 2kn N -1
-j
DFT : X (k )   x(n)e N
  x(n)WNnk
n 0 n 0

N -1 2kn N -1
1 j 1 - nk
IDFT : x(n) 
N
 X ( k )e
k 0
N

N
 X (k )W
k 0
N
Matrix Formulation of DFT

 In matrix form: DFT : X N  WN x N


0 0
 X (0)  WN WN WN0 ... WN0   x ( 0) 
 X (1)  W 0 W 1 W 2
... WNN -1

x (1) 
   N N N  
2  N -1 
 X (2)  WN0 WN2 WN4 ... WN  x(2) 
 .  . . . . . . . 
    
 .   . . . . .  . 
 .   . . . . .

. 
   
 N -1 N -1  x ( N - 1) 
 X ( N - 1) 0
 WN WN
N -1
WN2  N -1 ... WN   
1 -1
IDFT : x N  W X N  WN X N
N
N
Example 1

 Find the DFT for the sequence x(n) =


{1,2,1,0} by using matrix formulation tehnique
Solution to Example 1

 As N = 4, the substitute WN will be:


kn
-j
nk 2
W N e

-j
2
 
WN  e  cos - j sin -j
2 2
Solution to Example 1

 The matrix formulation would be:


 X (0)  WN0 WN0 WN0 WN0   x(0)  - j 0 - j 0 - j0 - j 0  1 
 X (1)   0 1 2 3    0 1 3  
 W
 N W N W N W N
x (1)  - j - j - j2 - j  2
. .
 X (2) WN WN WN WN   x(2) - j 0 - j 2
0 2 4 6
- j4 6
- j 1 
   0 3 6 9    0 3 9  
 X (3)  WN WN WN WN   x(3)  - j - j - j6 - j  0
1 1 1 1  1   1  2  1   4 
1 - j - 1 j  2 1 - j 2 - 1 - j 2
 .     
1 - 1 1 - 1  1  1 - 2  1   0 
      
1 j - 1 - j 0
   1  j 2 - 1  j 2 
Solution to Example 1

 The result is:


 X (k )  {4,- j 2,0, j 2}
7.2

PROPERTIES AND
RELATIONSHIP TO Z-
TRANSFORM
DFT Properties
DFT Properties

 One of the most useful DFT properties is the


symmetry property
 The DFT of a real sequence possesses
conjugate symmetry about the origin:
X (-k )  X  (k )
 The conjugate symmetry is at k = 0.5N
Example 3

 Find the 8-point DFT of a sequence:


x(n)  1,1,0,0,0,0,0,0
Solution to Example 3

 The DFT would be:


7 kn k
-j -j
X ( k )   x ( n )e 4
 1 e 4

n 0
 Calculate only from X(0) until X(4), as after
that the conjugate symmetry property will
handle it:
X (2)  1 - j
X (0)  2
X (3)  0.2929 - j 0.7071
X (1)  1.7071 - j 0.7071
X (4)  0
Solution to Example 3

 As N = 8 is an even number, the values will


be conjugate symmetry at 0.5N = 4:

 The values for X(5), X(6) and X(7):


X (5)  X  (3)  0.2929  j 0.7071
X (6)  X  (2)  1  j
X (7)  X  (1)  1.7071  j 0.7071
Solution to Example 3

 Hence, the overall X(k) are:


 X (k )  {2,1.7071 - j 0.7071,1 - j ,0.2929 - j 0.7071,
0,0.2929  j 0.7071,1  j ,1.7071  j 0.7071}
DFT and z-Transform Relationship

 Recall z-transform definition:



-n
X ( z)   x ( n) z
n  -
 Recall frequency response using DTFT:
j
ze

- j n
 X ( )   x ( n )e
n  -
DFT and z-Transform Relationship

 Recall frequency sampling in introduction of


2k
DFT: 2k  - j n
 ,  X ( k )   x ( n )e N
N n  -
 As for that, the direct transformation from z-
transform to DFT is:
j 2k N
ze
 
-n - j 2kn N
 X ( z)   x ( n) z
n  -
 X (k )   x ( n)e
n  -
7.3

INVERSE DISCRETE FOURIER


TRANSFORM (IDFT)
IDFT

 IDFT is defined by:


N -1 2kn
1 j
x ( n) 
N
 X ( k )e
k 0
N

 The sequence x(n) will results in the same


number (point) as in X(k)
Example 4

 Let X(k) = {4,-j2,0,j2}. Find its IDFT.


Solution to Example 4

 Using the IDFT equation:


N -1 2kn kn
1 j 1 3 j
x ( n) 
N
 X ( k )e
k 0
N
  X ( k )e 2
4 k 0
1 3 1
x(0)   X (k )  4 - j 2  j 2   1
4 k 0 4
k  3
1 3 j 1  j j 
x(1)   X (k )e 2   4 - j 2e 2  j 2e 2 2

4 k 0 4 
1 3 1

x(2)   X (k )e jk  4 - j 2e j  j 2e j 3
4 k 0 4
1
3k 3 9
1 3 j 1  j j 
x(3)   X (k )e 2   4 - j 2e 2  j 2e 2 0

4 k 0 4 
Solution to Example 4

 Hence, the overall x(n) are:


 x(n)  {1,2,1,0}
IDFT by Using Matrix Formulation

 Recall the IDFT equation by using matrix


formulation:
-1 1 
x N  W X N  WN X N
N
N
 WN* means that the matrix WN needs to be
transpose and complex conjugate (conjugate
transpose)
 This is a very good advantage as for IDFT
can be obtained from its DFT
Example 4

 Let X(k) = {4,-j2,0,j2}. Find its IDFT by using


matrix formulation.
Solution to Example 4

 By using the same WN as in Example 1, the


DFT can be obtained, where WN needs to be
conjugate transpose
WN  WN   WN
T

complex
transpose conjugate

1 1 1 1  1 1 1 1  1 1 1 1
1 - j - 1 j  1 - j - 1 j  1 j - 1 - j 
   
1 - 1 1 - 1  1 - 1 1 - 1  1 - 1 1 - 1 
     
1 j - 1 - j  1 j - 1 - j  1 - j - 1 j 
Solution to Example 4

 Evaluate IDFT using the matrix formulation


equation: 1 
xN  WN X N
N
 x(0)  1 1 1 1   4  1 
 x(1)  1 j - 1 - j  - j 2 2
 1 .  
 x(2) 4 1 - 1 1 - 1   0  1 
      
 x(3)  1 - j - 1 j   j 2  0
 x(n)  {1,2,1,0}
7.4

FAST FOURIER TRANSFORM


(FFT) AND INVERSE FAST
FOURIER TRANSFORM (IFFT)
Introduction to FFT

 Even though DFT is a very useful and


implement-friendly transform of a discrete
sequence, it has one major disadvantage:
– Heavy computation when N is increase
 FFT is developed to overcome the DFT
problem, it is not another kind of transforms
 To simplified, FFT is a fast (computationally
efficient) way to calculate DFT
FFT Functionality

 FFT works by making use of periodicities and


symmetries in the exponential function e-j2πnk/N
 FFT will decomposes the set of data to be
transformed into a series of smaller data sets to
be transformed
 Then, it decomposes those smaller sets into
even smaller sets
 At each stage of processing, the results of the
previous stage are combined in special way
 Finally, it calculates the DFT of each small data
set
FFT Functionality

 For example, an FFT of size 16 is broken into 2 FFTs of


size 8, which are broken into 4 FFTs of size 4, which are
broken into 8
FFTs of size
2, which are
broken into
16 FFTs of
size 1
FFT Functionality

 It is possible to take the DFT of the first N/2


points and combine them in a special way with
the DFT of the second N/2 points to produce a
single N-point DFT (symmetry property)
 Each of these N/2-point DFTs can be calculated
using smaller DFTs in the same way
 This is called radix-2 FFT where r = 2 for rm = N
FFT Efficiency

 Normal DFT calculation needs N2 operations


for N points
 FFT total computation (for radix-2) takes only
Nlog2N
 Therefore, the ratio between a DFT
computation and an FFT computation for the
same N is proportional to N/log2N
 FFT becomes very efficient compared to
normal DFT calculation when N is increased
The Radix of FFT

 Radix is the size of FFT decomposition


 The most common and familiar FFT
implementation is radix-2
 There are some other radix that have been
used such as radix-4, where it has an
interestingly "twiddle factors“, which are all 1,
-1, j, or -j, that can be applied without any
multiplications at all (observe Example 1
using matrix formulation)
IFFT

 The inverse Fast Fourier Transform (IFFT)


will have the same implementation and
computational method as in FFT, except for
the multiplication with 1/N and the transpose
conjugate of the previous FFT
7.5

CONVOLUTION USING DFT


TECHNIQUE
Convolution in DFT

 Usually, when convolution involve in time-domain, it


will be converted into as multiplication in that
transform domain (s-domain, ω-domain, z-domain,
etc). Same for DFT
 Recall the convolution steps in transform-domain (in
k-domain)
1. x1(n)  X1(k)
2. x2(n)  X2(k)
3. X3(k) = X1(k) X2(k)
4. X3(k)  x3(n)
Convolution in DFT

 Interestingly, in DFT there will always be two


kind of convolution occurred:
1. Circular convolution
2. Linear convolution (the regular convolution)
 This is due to restricting the convolution to N-
point convolution
 Changing the value of N-point will resulted in
a very different convolution results
Circular Convolution in DFT

 Usually, in a regular (linear) convolution, the length


of the resulted sequence, N will be:
N  L  M -1
where L is the length for first sequence and M is the
length of the second sequence
 Circular convolution in DFT occurred when two
discrete sequence with the same length L = M are
being convolved in the same length of the resulted
sequence:
N LM
Example 4

 Determine the 4-point circular convolution of


the two sequence x1(n) and x2(n) given by:
x1 (n)  {1,2,0,1} & x2 (n)  {2,2,1,1}
Solution to Example 4

 The convolution needs to be a 4-point in results, as


for that circular convolution will be provoked
 Step 1: Transform from x1(n) to X1(k) using DFT
3 - jkn - jk - j 3k
X 1 (k )   x1 (n)e 2
 1  2e 2
e 2

n 0

X 1 ( 0)  1  2  1  4
- j - j 3
2 2
X 1 (1)  1  2e e  1- j
X 1 (2)  1  2e - j  e - j 3k  -2
X 1 (3)  1  j using the conjugate
 X 1 (k )  {4,1 - j ,-2,1  j} symmetry property
Solution to Example 4

 Step 2: Transform from x2(n) to X2(k) using DFT


3 - jkn - jk - j 3k
- jk
X 2 ( k )   x2 ( n ) e 2
 2  2e 2
e e 2

n0

X 2 (0)  2  2  1  1  6
- j - j 3
2 - j 2
X 2 (1)  2  2e e e  1- j
X 2 (2)  2  2e - j  e - j 2  e - j 3  0
X 2 (3)  1  j
 X 2 (k )  {6,1 - j ,0,1  j}
 Step 3: Multiply X1(k) with X2(k)
X 3 (k )  X 1 (k ) X 2 (k )  {4,1 - j ,-2,1  j}  {6,1 - j ,0,1  j}  {24,- j 2,0, j 2}
Solution to Example 4

 Step 3: Inverse X3(k)


kn n 3n
1 3 j 1 j j 
x ( n )   X ( k )e 2  2
  24 - j 2e  j 2e 2 

4 k 0 4 
1
x(0)  24 - j 2  j 2  6
4
 3
1 j j 
x(1)   24 - j 2e 2  j 2e 2   7
4 
1
 
x(2)  24 - j 2e j  j 2e j 3  6
4
3 9
1 j j 
x(3)   24 - j 2e  j 2e 2   5
2
4 
 x(n)  {6,7,6,5}
Problem 5.14

 Consider the sequences


x1 (n)  {0,1,2,3,4} x2 (n)  {0,1} s (n)  {1}
 For 5-point DFT,
a) Determine a sequence y(n) so that Y(k)=X1(k) X2(k)
b) Obtain the sequence x3(n) such that S(k)=X1(k) X3(k)
Solution to Problem 5.14

 As x2(n) and s(n) is not a 5-point sequence,


zero should be padded to fulfill the emptiness
of both sequences
 After zero-padding both of the sequences:
x1 (n)  {0,1,2,3,4}
x2 (n)  {0,1,0,0,0}
s (n)  {1,0,0,0,0}
Solution to Problem 5.14(a)

 To find y(n), x1(n) needs to be circular convolved


with x2(n):
4 - j 2nk - j 2k - j 4k - j 6k - j 8k
X 1 ( k )   x1 (n)e 5
e 5
 2e 5
 3e 5
 4e 5

n 0

X 1 (0)  1  2  3  4  10
- j 2 - j 4 - j 6 - j 8
5 5 5 5
X 1 (1)  e  2e  3e  4e  -2.5  j 3.441
- j 4 - j 8 - j12 - j16
5 5 5 5
X 1 ( 2)  e  2e  3e  4e  -2.5  j 0.8123
X 1 (3)  -2.5 - j 0.8123
X 1 ( 4)  -2.5 - j 3.441
 X 1 ( k )  {10,-2.5  j 3.441,-2.5  j 0.8123,-2.5 - j 0.8123,-2.5 - j 3.441}
Solution to Problem 5.14(a)
4 - j 2nk - j 2k
X 2 ( k )   x2 ( n )e 5
e 5

n 0

X 2 ( 0)  1
- j 2
5
X 2 (1)  e  0.309 - j 0.9511
- j 4
5
X 2 ( 2)  e  -0.809 - j 0.5878
X 2 (3)  -0.809  j 0.5878
X 2 ( 4)  0.309 - j 0.9511

 X 2 ( k )  {1,0.309 - j 0.9511,-0.809 - j 0.5878,


- 0.809  j 0.5878,0.309  j 0.9511}
Solution to Problem 5.14(a)

Y (k )  X 1 (k ) X 2 (k )
 {10,2.5  j3.441,2.5  j 0.8123,2.5 - j 0.8123,2.5 - j 3.441}

2kn
1 5 j
y ( n )   Y ( k )e 5
4 k 0
2k 4k
 j j 
1 10  2.5  j 3.441e
 5
 2.5  j 0.8123e 5 
  6k 8k

4 j j 
  2 .5 - j 0 . 8123e 5
 2 . 5 - j 3 .441e 5

 y (n)  {4,0,1,2,3}
Solution to Problem 5.14(b)
4 - j 2nk
 Obtain the DFT of s(n):
S ( k )   s ( n )e 5
1
n 0

S (0)  S (1)  S ( 2)  S (3)  S ( 4)  1


 S ( k )  {1,1,1,1,1}
 Calculate X3(k):
S (k ) {1,1,1,1,1}
X 3 (k )  
X 1 (k ) 10,-2.5  j 3.441,-2.5  j 0.8123,
 
 - 2 . 5 - j 0 . 8123 , - 2 . 5 - j 3 . 441 
0.1,-0.1382 - j 0.1902,-0.3618 - j 0.1176,
 
 - 0 . 3618  j 0 . 1176 , - 0 . 1382 - j 0 . 1902 
Solution to Problem 5.14(b)

 Inversing X3(k) with IDFT to find x3(n):


x3 (n)
2kn
1 5 j
  X 3 ( k )e 5
4 k 0
2k 4k
 j j 
1 0.1  - 0.1382 - j 0.1902e
 5
 - 0.3618 - j 0.1176e 5 
  6k 8k

4 j j 
  - 0. 3618  j 0 . 1176 e 5
 - 0 . 1382 - j 0 . 1902 e 5

 x3 (n)  {- 0.18,0.22,0.02,0.02,0.02}
Linear Convolution in DFT

 To perform the linear convolution, the length


of the resulted sequence N must be:
N  L  M -1
where L is the length for first sequence and
M is the length of the second sequence
 The process is the same as in circular
convolution, where both sequences need to
be padded with zeros for length to become N
Example 5

 Determine the linear convolution of the two


sequence x1(n) and x2(n) given by:
x1 (n)  {1,2,0,1} & x2 (n)  {2,2,1,1}
Solution to Example 5

 Calculate N: N  4  4 - 1  7
 Padding zeros to both sequences:
x1 (n)  {1,2,0,1,0,0,0}
x2 (n)  {2,2,1,1,0,0,0}
 Obtain the DFT for both sequences:
4,1.346 - j1.9975,1.1784 - j1.168,-1.0245 - j1.8427,
X 1 (k )   
- 1.0245  j1.8427,1.1784  j1.168,1.346  j1.9975 
6,2.1235 - j 2.9725,1.2775 - j 0.7341,0.599 - j1.0609,
X 2 (k )   
0.599  j1.0609,1.2775  j 0.7341,2.1235  j 2.9725 
Solution to Example 5

 The result from linear convolution:


X 3 (k )
 X 1 (k ) X 2 (k )
24,-3.0794 - j8.2428,0.6479 - j 2.3573,-2.5685 - j 0.017,
 
 - 2. 5685  j 0. 017, 0. 6479  j 2 . 3573, - 3. 0794  j 8 . 2428 
 Inversing the result to obtain its sequence in
time-domain:
 x3 (n)  {2,6,5,5,4,1,1}
Example 5.3.1

 By means of the DFT and IDFT, determine


the response of the FIR filter with impulse
response
h(n)  {1,2,3}
to the input sequence
x(n)  {1,2,2,1}
Solution to Example 5.3.1

 First, determine the linear convolution length:


N  3  4 -1  6
 Padding h (n) and x(n) with zeros:
h(n)  {1,2,3,0,0,0}
x(n)  {1,2,2,1,0,0}
 Obtaining the DFTs:
6,0.5 - j 4.3301,-1.5  j 0.866,
H (k )   
2,-1.5 - j 0.866,0.5  j 4.3301 
X (k )  6,- j 3.4641,0,0,0,- j 3.4641
Solution to Example 5.3.1

 Calculating Y(k):
Y (k )  H (k ) X (k )  36,-15 - j1.7321,0,0,0,-15  j1.7321
 Obtaining y(n) by using IDFT:
 y (n)  {1,4,9,11,8,3}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy