Discrete Fourier Transform (DFT) : Chirayu D. Athalye
Discrete Fourier Transform (DFT) : Chirayu D. Athalye
Chirayu Athalye
Basics of DFT
DFT Matrix
DFT Properties
FFT
Discrete Fourier Transform (DFT) Case Studies
References
Chirayu D. Athalye
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 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
Let x̃[·] be periodic with the fundamental period N, and x[·] be the corresponding finite Basics of DFT
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
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
iω
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.
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
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 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].
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
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
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
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
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].
Chirayu Athalye
Basics of DFT
DFT Matrix
DFT Properties
FFT
Decimation-in-Time
Decimation-in-Frequency
Case Studies
References
Chirayu Athalye
Basics of DFT
DFT Matrix
DFT Properties
FFT
Decimation-in-Time
Decimation-in-Frequency
Case Studies
References
(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
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
Chirayu Athalye
Basics of DFT
DFT Matrix
DFT Properties
FFT
Decimation-in-Time
Decimation-in-Frequency
Case Studies
References
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
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
DFT Properties
Consider polynomials a, b : C → C given by FFT
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?
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
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,
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
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
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
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].