0% found this document useful (0 votes)
3 views

Discrete Fourier Transform (DFT) : Chirayu D. Athalye

discrete fourier transform

Uploaded by

rem beauty
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)
3 views

Discrete Fourier Transform (DFT) : Chirayu D. Athalye

discrete fourier transform

Uploaded by

rem beauty
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/ 24

DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Discrete Fourier Transform (DFT) Case Studies

References

Chirayu D. Athalye

Department of Electrical & Electronics Engineering,


BITS Pilani, K K Birla Goa Campus.

2024
DFT
Questions
Chirayu Athalye
1 What is Discrete Fourier Transform (DFT)? Why do we need it?
Basics of DFT
2 How is it related to DTFT and DFS? DFT Matrix

DFT Properties

Though DTFT is a useful analytical tool, it is not practical for numerical computations. FFT

Case Studies
For finite length sequences, using Nyquist-Shannon Sampling Theorem, one can work with
References
uniformly spaced samples of DTFT.
DFT of a finite length sequence x[·] is obtained by sampling one period of its DTFT.
DFT is an effective computational tool.

Questions
1 Are DFS and DTFT related via sampling?
2 Does uniform sampling (sampling period: T ) of a periodic analog signal (fundamental
period: T0 ) lead to a periodic discrete sequence?

Remark
Uniform sampling (sampling period: T ) of a periodic analog signal (fundamental period: T0 )
lead to a periodic discrete sequence iff TT0 ∈ Q.
DFT
Let x[·] be a finite length sequence of length N.
Chirayu Athalye
For finite length sequences, unless specified otherwise, we assume that the starting index is n = 0.
Basics of DFT
DFT DFT Matrix

N−1 DFT Properties


X
Analysis Equation: X [k] := x[n] WNkn , ∀k ∈ {0, . . . , N − 1}; FFT

n=0 Case Studies

N−1 References
1 X i 2π
Synthesis Equation: x[n] = X [k] WN−kn , where WN := e − N
N
k=0

DF T
DFT Pair: x[n] ←−−→ X [k] N th Roots of Unity: {WNk | k = 0, . . . , N − 1}.
Remark: Compare the above equations with Analysis and Synthesis Equations of DFS.

i 2π
Useful Properties of WN = e − N

Periodicity: WN
(k+N)
= WNk . Conjugate Symmetry: (WNk )∗ = WN−k .
N (k+ N )
WN0 = WNN = 1. WN2 = −1; thus, WN 2
= −WNk .
N 3N
WN4 = −i and WN4 = i. WN2k = W Nk .
2
DFT

Relation Between DFT and DFS Chirayu Athalye

Let x̃[·] be periodic with the fundamental period N, and x[·] be the corresponding finite Basics of DFT

length sequence of length N. DFT Matrix

DFT Properties
Recall that for n ∈ Z, (
FFT
1, if 0 ≤ n ≤ N − 1
x[n] = x̃[n] wN [n], where wN (n) := Case Studies
0, otherwise; References

x̃[n] = x[n modulo N] = x[((n))N ].


DF S DF T
Let x̃[n] ←−
−→ X̃ [k] and x[n] ←−−→ X [k]. Then,
(
X̃ [k], if 0 ≤ k ≤ N − 1
X [k] =
0, otherwise;
X̃ [k] = X [((k))N ], ∀k ∈ Z.

Remark
1 For a sequence of length of N, typically, we consider N point DFT (Nyquist-Shannon Rate).
2 However, in principle, one can consider M point DFT where M ≥ N.
DFT

Chirayu Athalye
Relation Between DTFT and DFT
Basics of DFT
Let x[·] be a finite length sequence of length N.
DFT Matrix
DT F T DF T
Let x[n] ←−−−→ X (e iω ) and x[n] ←−−→ X [k]. Then, DFT Properties

FFT

X [k] = X (e ) |ω= 2πk , ∀k ∈ {0, . . . , N − 1}. Case Studies
N
References
DFT of a finite length sequence x[·] is obtained by sampling one period of its DTFT.

Relation Between DTFT and DFS (Different Perspective)


Let x̃ : Z → C be periodic with the fundamental period N, and x[·] be the corresponding
finite length sequence of length N.
Notice that x̃[·] is a periodic extension (with fundamental period N) of x[·].
DT F T DF S
Let x[n] ←−−−→ X (e iω ) and x̃[n] ←−
−→ X̃ [k]. Then,

X̃ [k] = X (e iω ) |ω= 2πk , ∀k ∈ Z.


N

DFS of a periodic sequence x̃[·] is obtained by sampling X (e iω ).


DFT

Chirayu Athalye
DFT Analysis Equation (Matrix Form)
  Basics of DFT

X [0]
 1 1 1 ··· ··· 1 x[0]
 
DFT Matrix
N−1
 X [1]  1
 WN1 WN2 ··· ··· WN   x[1] 

DFT Properties
2(N−1)  
 X [2]  1 WN2 WN4 ··· ··· WN   x[2] 
   
FFT
 . .. .. ..
.. .. ..
  
 = . Case Studies
.
  
 .  . . . ··· .  . 
References
  .. .. .. ..
    
 .
.. ..  .
.

  .
 . . ··· . . 

 . 
X [N − 1] WNN−1
2(N−1)
··· ···
(N−1)(N−1) x[N − 1]
| {z } |1 WN
{z
WN
}| {z }
X x
DN

DFT Matrix: DN ∈ CN×N . Analysis Equation: X = DN x.

Example (N = 4)
      
X [0] 1 1 1 1 x[0] 1 1 1 1
X [1] 1 W41 W42 3 
W4  x[1] 1 −i −1 i 
X [2] = 1 D4 = 
    
W42 W44 W46  x[2] 1 −1 1 −1
X [3] 1 W43 W46 W49 x[3] 1 i −1 −i
DFT

Chirayu Athalye

DFT Synthesis Equation (Matrix Form: x = DN−1 X) Basics of DFT

  DFT Matrix
1 1 1 ··· ··· 1 DFT Properties
−(N−1)
1
 WN−1 WN−2 ··· ··· WN 
 FFT
−2(N−1)
1 WN−2 WN−4 ··· ··· WN
 
 Case Studies
1 
 .. .. .. ..  = 1 DN∗ .
DN−1 ..

= .
References
N. . . ··· . 
 N
. .. .. .. ..
 ..

 . . ··· . . 

−(N−1) −2(N−1) −(N−1)(N−1)
1 WN WN ··· ··· WN

Example (N = 4)
      
x[0] 1 1 1 1 X [0] 1 1 1 1
x[1] 1 1 W4−1 W4−2 −3  
W4  X [1] 1 1 i −1 −i 
x[2] = 4 1 D4−1 = 
W4−2 W4−4 W4−6  X [2]
    
4 1 −1 1 −1
x[3] 1 W4−3 W4−6 W4−9 X [3] 1 −i −1 i
DFT
DFT Properties
Chirayu Athalye

Basics of DFT

DFT Matrix
1 Let x1 , x2 , x, y : Z → C be finite length sequences of length N.
DFT Properties
i 2π
2 Recall that WN = e − N . FFT

Case Studies

Linearity References

DF T DF T
If x1 [n] ←−−→ X1 [k] and x2 [n] ←−−→ X2 [k], then for arbitrary a, b ∈ C, we have
DF T
a x1 [n] + b x2 [n] ←−−→ a X1 [k] + b X2 [k].

Circular Shifting Parseval’s Relation


DF T
Let x[n] ←−−→ X [k].
N−1 N−1
DF T 1 X
x[((n − m))N ] ←−−→ WNkm X [k], where m ∈ Z.
X
1
|x[n]|2 = |X [k]|2 .
DF T N
2 WN−`n x[n] ←−−→ X [((k − `))N ], where ` ∈ Z. n=0 k=0
DFT
Circular Reversal and Duality Chirayu Athalye

DF T
DF T
x[n] ←−−→ X [k]. Circular Reversal: x[((−n))N ] ←−−→ X [((−k))N ]. Basics of DFT

DFT Matrix

DFT Properties
DF T
Duality: X [n] ←−−→ N x[((−k))N ]. FFT

Case Studies
Time Expansion References
(  
x n` , if n is a multiple of `
Let ` ∈ N and x(`) [n] :=
0, otherwise.
Remark: Time-stretched sequence x(`) [·] is obtained from x[·] by placing (` − 1) zeros between
values of x[·]. Thus, x(`) [·] is a sequence of length `N.
DF T
x(`) [n] ←−−→ X [k] + X [k − N] + · · · + X [k − (` − 1)N].

Example
DF T
x[n] = {2, 4, 1, 3} ←−−→ {10, 1 − i, −4, 1 + i}
DF T
x(2) [n] = {2, 0, 4, 0, 1, 0, 3, 0} ←−−→ {10, 1 − i, −4, 1 + i, 10, 1 − i, −4, 1 + i}
DFT

Conjugation Chirayu Athalye

DF T DF T
If x[n] ←−−→ X [k], then x ∗ [n] ←−−→ X ∗ [((−k))N ]. Basics of DFT

DFT Matrix

DFT Properties
Conjugate Symmetry for Real-Valued Sequences
FFT
If x[n] is a real-valued sequence, then X [k] = X ∗ [((−k))N ]. In other words, Case Studies

References
X [k] = X ∗ [N − k], ∀ k ∈ {1, . . . , N − 1}; i.e.,
  
1 Re X [k] = Re X [((−k))N ] and X [k] = X [((−k))N ] ; whereas,
  
2 Im X [k] = −Im X [((−k))N ] and ]X [k] = −]X [((−k))N ].
 DF T   DF T 
Furthermore, Evc x[n] ←−−→ Re X [k] and Odc x[n] ←−−→ iIm X [k] , where
 x[n] + x[((−n))N ] 
Evc x[n] := = Ev x̃[n] u[n] − u[n − N]),
2
 x[n] − x[((−n))N ] 
Odc x[n] := = Od x̃[n] u[n] − u[n − N]).
2
 
Remark: Notice that Evc x[n] and Odc x[n] are also sequences of length N.
DFT

Example (Conjugate Symmetry of DFT) Chirayu Athalye

1 N = 8. Basics of DFT

x[n] = {3.875, −3.8499, 2.375, −0.5821, 0.375, 1.0999, −0.125, 0.8321}, DFT Matrix

X [k] = {4, 1 + 2i, 2 + 3i, 6 + 7i, 9, 6 − 7i, 2 − 3i, 1 − 2i}. DFT Properties

FFT
2 N = 7. Case Studies

x[n] = {3.2857, −2.6325, 2.3745, −1.8789, 1.8711, 0.4226, 1.5575}, References

X [k] = {5, 2 + 3i, 1 + 2i, 6 + 7i, 6 − 7i, 1 − 2i, 2 − 3i}.

DF T DF T
x1 [n] ←−−→ X1 [k] and x2 [n] ←−−→ X2 [k].

Convolution Property
 DF T
N Point Circular Convolution: x1 ~ x2 [n] ←−−→ X1 [k] X2 [k].

Multiplication/Modulation Property
DF T 1 
x1 [n] x2 [n] ←−−→ X1 ~ X2 [k]. (N Point Circular Convolution)
N
DFT

Chirayu Athalye
Fast Fourier Transform (FFT)
Basics of DFT
An efficient way to compute DFT by exploiting the structure of a DFT matrix.
DFT Matrix
FFT is a divide-and-conquer algorithm (developed by Cooley and Tuckey in 1965). DFT Properties

We will cover radix-2 FFT algorithm (applicable when N = 2m ). (Complexity: O(N log2 N)) FFT
Decimation-in-Time
Decimation-in-Frequency

Decimation-in-Time FFT Algorithm (Basic Idea) Case Studies

References
DF T
1 Let x[·] be a sequence of length N, where N = 2m , and x[n] ←−−→ X [k].
N
DF T DF T
2 Let g [n] := x[2n] and h[n] := x[2n + 1]. Let g [n] ←−−→ G [k] and h[n] ←−−→ H[k].
N/2 N/2
N
3 For k ∈ {0, . . . , 2
− 1},
X [k] = G [k] + WNk H[k],
(k+ N )
X [k + N
2
] = G [k] + WN 2
H[k] = G [k] − WNk H[k].

Remark: Equivalently, X [k] = G ((k)) N + WNk H ((k)) N ,


   
∀ k ∈ {0, . . . , N − 1}.
2 2
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Decimation-in-Time
Decimation-in-Frequency

Case Studies

References

Figure: Decomposition of N-Point DFT Computation


N
into Two 2 -Point DFT Computations (N = 8).

Recall that W Nk = WN2k .


2
N
Figure: Decomposition of 2 -Point DFT Computation
N
Two 4 -Point DFT Computations (N = 8).
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Decimation-in-Time
Decimation-in-Frequency

Case Studies

References

Figure: Decimation-in-Time FFT for N = 8.

(k+ N )
Remark: This can be simplified using WN 2
= −WNk .
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Decimation-in-Time
Decimation-in-Frequency

Case Studies

References

Figure: Simplified (Butterfly Computation) Decimation-in-Time FFT for N = 8.

X [k]
Remark: For inverse FFT, use as the input and replace WN by WN−1 in the above diagram.
N
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Decimation-in-Time
Decimation-in-Frequency

(a) Decimation-in-Time (b) Decimation-in-Frequency Case Studies

Figure: Typical Butterfly Computation in FFT References

Decimation-in-Frequency FFT Algorithm (Basic Idea)


DF T
1 Let x[·] be a sequence of length N, where N = 2m , and x[n] ←−−→ X [k].
N
DF T DF T
2 Let V [k] := X [2k] and Y [k] := X [2k + 1]. Let v [n] ←−−→ V [k] and y [n] ←−−→ Y [k].
N/2 N/2

3 For n ∈ {0, . . . , N2 − 1},


N
v [n] = x[n] + x[n + 2
],
(n+ N )
y [n] = WNn x[n] + WN N
= WNn x[n] − x[n + N
2

x[n + 2
] 2
] .
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Decimation-in-Time
Decimation-in-Frequency

Case Studies

References

Figure: Decomposition of N-Point DFT Computation N


Figure: Decomposition of 2 -Point DFT Computation
N N
into Two 2 -Point DFT Computations (N = 8). Two 4 -Point DFT Computations (N = 8).

Remark
Decimation-in-Time FFT and Decimation-in-Frequency FFT signal flow graphs are transpose of each
other; i.e., one is obtained from the other by reversing the arrows, and relabeling the input-output nodes.
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties

FFT
Decimation-in-Time
Decimation-in-Frequency

Case Studies

References

Figure: Decimation-in-Frequency FFT for N = 8.

X [k]
Remark: For inverse FFT, use as the input and replace WN by WN−1 in the above diagram.
N
DFT
Problem Statement Chirayu Athalye

How to do polynomial multiplication using FFT? Can you explain why this method works?
Basics of DFT

Example DFT Matrix

DFT Properties
Consider polynomials a, b : C → C given by FFT

a(t) := 5t 4 − 3t 3 + 4t 2 − 2t + 1, b(t) := t 3 + 3t 2 + 4t + 2. Case Studies


Polynomial Multiplication
using FFT
Find c(t) := a(t) b(t). Circular Convolution: Linear
Convolution with Aliasing

References
High-School Algebra
We can easily compute the polynomial c : C → C; it is given by
c(t) := 5t 7 + 12t 6 + 15t 5 + 8t 4 + 5t 3 + 3t 2 + 2. (deg(c) = 7)
Can the method learned in school be implemented on a computer? Is it numerically efficient?

Polynomial Multiplication using Linear Convolution


Let a[n] := { 1 , −2, 4, −3, 5} and b[n] := { 2 , 4, 3, 1}. Then,
↑ ↑
n=0 n=0

c[n] := (a ∗ b)[n] = { 2 , 0, 3, 5, 8, 15, 12, 5} (Lc = La + Lb − 1 = 8).



n=0
DFT

Chirayu Athalye
Polynomial Multiplication using Circular Convolution
Basics of DFT
Let azp [n] := {1, −2, 4, −3, 5, 0, 0, 0} and bzp [n] := {2, 4, 3, 1, 0, 0, 0, 0}. Then, DFT Matrix

c[n] := (azp ~ bzp )[n] = {2, 0, 3, 5, 8, 15, 12, 5}. DFT Properties
↑ FFT
N=8
Case Studies
2
Remark: Linear/Circular convolution approach requires O(N ) flops. Polynomial Multiplication
using FFT
Circular Convolution: Linear
Convolution with Aliasing
Polynomial Multiplication using FFT References

DF T DF T DF T
Let azp [n] ←−−→ A[k], bzp [n] ←−−→ B[k], and c[n] ←−−→ C [k].
A[k] = {5, −3.2929 − 0.4645i, 2 − i, −4.7071 + 7.5355i, 15, −4.7071 − 7.5355i, 2 + i, −3.2929 + 0.4645i},
B[k] = {10, 4.1213 − 6.5355i, −1 − 3i, 0.1213 − 0.5355i, 0, 0.1213 + 0.5355i, −1 + 3i, 4.1213 + 6.5355i},
C [k] = A[k] B[k].

Remark: Compute A[k] and B[k] using FFT; and then c[n] using inverse FFT. This method appears
cumbersome to do manually, but it is numerically efficient to implement on a computer.

What do A[k], B[k], and C [k] signify for the corresponding polynomials?
DFT

Chirayu Athalye
Remark
4 7 3 7 Basics of DFT
X n
X n
X n
X n
1 Note that a(t) = a[n] t = azp [n] t and b(t) = b[n] t = bzp [n] t . DFT Matrix

n=0 n=0 n=0 n=0 DFT Properties

2 Let tk = WNk for k ∈ {0, . . . , N − 1}. In this case, N = 8. FFT

Case Studies
3 Notice that A[k] = a(tk ) and B[k] = b(tk ). Polynomial Multiplication
using FFT
4 Similarly, C [k] determines the polynomial c(·) at N distinct points {t0 , . . . , tN−1 }. Circular Convolution: Linear
Convolution with Aliasing

References

Proposition

Given (d + 1) pairs (t0 , y0 ), (t1 , y1 ), . . . , (td , yd ) , with all
tk ’s distinct, there exists a unique polynomial p(·) such that
deg(p) ≤ d and p(tk ) = yk for 0 ≤ k ≤ d,

Figure: 8th Roots of Unity.


DFT

Chirayu Athalye
Problem Statement
Basics of DFT
Using convolution properties, derive the method of obtaining circular convolution from linear DFT Matrix
convolution. In other words, prove that circular convolution is linear convolution with aliasing. DFT Properties

FFT

Recall: Relation between Periodic and Circular Convolutions Case Studies


Polynomial Multiplication
Let x̃1 [·] and x̃2 [·] be periodic with period N. using FFT
Circular Convolution: Linear
Convolution with Aliasing
Let x1 [·] and x2 [·] be the corresponding finite length sequences of length N.
References
Let ỹ [n] := (x̃1 ~ x̃2 )[n] and y [n] := (x1 ~ x2 )[n], where (x1 ~ x2 ) = (x1 N x2 ).
Recall that for all n ∈ Z,
ỹ [n] = (x̃1 ∗ x2 )[n],
y [n] = ỹ [n] wN [n],

where wN [n] := u[n] − u[n − N].

It suffices to show that periodic convolution is linear convolution with aliasing.


DFT
Remark Chirayu Athalye

X
Basics of DFT
Let pN [n] := δ[n − kN]. Recall that x̃1 [n] = (x1 ∗ pN )[n], ∀n ∈ Z. Therefore, for all n ∈ Z,
DFT Matrix
k=0
DFT Properties
ỹ [n] = (x̃1 ∗ x2 )[n] = (pN ∗ x1 ∗ x2 )[n]. FFT

Case Studies
Note that LHS is a periodic convolution, whereas RHS is a linear convolution with aliasing. Polynomial Multiplication
using FFT
Circular Convolution: Linear
Convolution with Aliasing

References

Figure: Circular Convolution.

Figure: Periodic Extension.


Figure: Linear Convolution with Aliasing.
DFT

Chirayu Athalye

Basics of DFT

DFT Matrix

DFT Properties
References
FFT

A.V. Oppenheim, R.W. Schafer, and J.R. Buck, Discrete-Time Signal Processing (2nd edition), Upper Saddle Case Studies

River, NJ, USA: Prentice Hall, 1999. References

S.K. Mitra, Digital Signal Processing: A Computer-Based Approach (4th edition), NY, USA: McGraw-Hill,
2010.

Readings
1 [Discrete-Time Signal Processing (Oppenheim et al.), Chapters 8 and 9].
2 [Digital Signal Processing (S.K. Mitra), Chapters 5 and 11].

You might also like