Update 20240918: I have found an absolutely amazing YouTube video on the linear algebraic perspective of this topic: The Linear Algebra behind sound

I also discovered this video: The math behind music | Linear Algebra episode 3 in a playlist on linear Algebra. I’ll have to watch the playlist for sure.

Discrete Fourier Transform (DFT)

Motivation and Historical Context

The Discrete Fourier Transform (DFT) is a mathematical tool that decomposes a sequence of complex or real numbers (a discrete signal) into its constituent frequency components. Historically, the DFT was developed as a discrete counterpart to the continuous Fourier transform, which was introduced by Joseph Fourier in the early 19th century. While the Fourier transform was initially used for solving problems like heat distribution, the DFT extends this idea to the digital domain, making it invaluable in many fields today, from signal processing to image compression and beyond.

Why It Matters

The DFT plays a critical role in various real-world applications:

  • Audio Processing: Decomposes sound into individual frequencies for analysis and filtering.
  • Image Compression: Algorithms like JPEG use DFT to transform images for efficient compression.
  • Signal Processing: Enables noise reduction and feature extraction in digital signals.
  • Medical Imaging: MRI and other imaging techniques rely on the DFT to reconstruct images from data.

0. Introductory/Informal Approach

Analogy: “Breaking Down a Musical Chord”

Imagine hearing a musical chord played on a piano. Even though it’s a blend of several notes, you can mentally distinguish the individual notes. The DFT performs a similar task—it takes a complex signal and breaks it down into simpler components (frequencies), revealing the “notes” (frequencies) that make up the signal.

Simple Intuition Behind the DFT

In the digital world, signals are often sequences of numbers. The DFT helps analyze such signals by transforming them into their frequency components. Think of the DFT as providing a “recipe” for how much of each frequency is present in the signal, much like a recipe specifies how much of each ingredient is in a dish.


1. Concrete/Computational Approach

Definition of the DFT

The Discrete Fourier Transform transforms a sequence of $ N $ complex numbers $ x_0, x_1, \dots, x_{N-1} $ into another sequence of $ N $ complex numbers $ X_0, X_1, \dots, X_{N-1} $, where:

$$ X_k = \sum_{n=0}^{N-1} x_n e^{-2\pi i k n / N}, \quad k = 0, 1, \dots, N-1 $$

This formula computes the contribution of the frequency $ k $ to the original signal.

Intuitive Interpretation

The DFT measures the similarity between the input signal and sinusoidal waves of different frequencies. Each value $ X_k $ represents the strength and phase of the frequency component $ k $. In simple terms, it tells you how much of each frequency is present in the original signal.

Step-by-Step Example

Let’s work through an example. Suppose we have a signal represented by four values:

$$ x = [1, 2, 3, 4] $$

We want to compute the DFT for this sequence.

For $ k = 0 $:

$$ X_0 = 1 \cdot e^{-2\pi i \cdot 0 \cdot 0 / 4} + 2 \cdot e^{-2\pi i \cdot 0 \cdot 1 / 4} + 3 \cdot e^{-2\pi i \cdot 0 \cdot 2 / 4} + 4 \cdot e^{-2\pi i \cdot 0 \cdot 3 / 4} = 10 $$

For $ k = 1 $:

$$ X_1 = 1 \cdot e^{-2\pi i \cdot 1 \cdot 0 / 4} + 2 \cdot e^{-2\pi i \cdot 1 \cdot 1 / 4} + 3 \cdot e^{-2\pi i \cdot 1 \cdot 2 / 4} + 4 \cdot e^{-2\pi i \cdot 1 \cdot 3 / 4} \approx -2 + 2i $$

Similarly, we compute for $ k = 2 $ and $ k = 3 $. The result is a new sequence of complex numbers that represent the frequency components of the original signal.

Common Misconceptions

  • Misconception: The DFT only works for periodic signals.
    Correction: The DFT applies to any discrete signal, but the assumption of periodicity is built into the mathematical framework of the DFT.

  • Misconception: The DFT outputs only real numbers.
    Correction: The DFT typically returns complex numbers, as it encodes both amplitude (strength) and phase information for each frequency.


2. Abstract/Theoretical Approach

DFT as a Linear Operator on $ \mathbb{C}^n $

Formally, the DFT is a linear transformation from the space of complex-valued sequences $ \mathbb{C}^n $ to itself. That is, the DFT can be understood as a map:

$$ \text{DFT}: \mathbb{C}^n \rightarrow \mathbb{C}^n $$

For any vector $ x = (x_0, x_1, \dots, x_{N-1}) \in \mathbb{C}^n $, the DFT produces a vector $ X = (X_0, X_1, \dots, X_{N-1}) \in \mathbb{C}^n $, using the formula:

$$ X_k = \sum_{n=0}^{N-1} x_n e^{-2\pi i k n / N}, \quad k = 0, 1, \dots, N-1 $$

Matrix Representation of the DFT

Since the DFT is a linear map between finite-dimensional spaces, it can also be written as a matrix multiplication. The DFT matrix $ F_N \in \mathbb{C}^{N \times N} $ has entries:

$$ (F_N)_{kn} = e^{-2\pi i k n / N} $$

The DFT of a vector $ x \in \mathbb{C}^n $ is then:

$$ \text{DFT}(x) = F_N x $$

The matrix $ F_N $ is unitary, meaning $ F_N F_N^* = I $, where $ F_N^* $ is the conjugate transpose. This implies that the DFT preserves the inner product and is invertible.

Key Properties of the DFT

  • Invertibility: The DFT is invertible, and the inverse DFT is given by:

    $$ x_n = \frac{1}{N} \sum_{k=0}^{N-1} X_k e^{2\pi i k n / N} $$
  • Orthogonality: The complex exponentials $ e^{-2\pi i k n / N} $ form an orthogonal basis for $ \mathbb{C}^n $. This orthogonality ensures that the transformation is energy-preserving.

  • Energy Preservation (Parseval’s Theorem): The DFT preserves the total energy of the signal, expressed as:

    $$ \sum_{n=0}^{N-1} |x_n|^2 = \frac{1}{N} \sum_{k=0}^{N-1} |X_k|^2 $$

    This property reflects the conservation of signal power across domains.

  • Circular Convolution: The DFT transforms circular convolution in the time domain into component-wise multiplication in the frequency domain. If $ x $ and $ y $ are two sequences, their circular convolution is:

    $$ (x * y)_n = \sum_{m=0}^{N-1} x_m y_{(n-m) \mod N} $$

    In the frequency domain:

    $$ \text{DFT}(x * y) = \text{DFT}(x) \odot \text{DFT}(y) $$

    where $ \odot $ denotes component-wise multiplication.

DFT and Harmonic Analysis

The DFT is closely related to harmonic analysis, where signals are decomposed into simpler waveforms (sinusoids). The DFT projects the input signal onto a basis of sinusoidal functions, revealing the “harmonic” structure of the signal.

Relation to Other Fields

  • Linear Algebra: The DFT can be interpreted as an eigenvalue decomposition of circular shift operators.
  • Group Theory: The DFT can be generalized to finite groups, forming the basis for the Fourier transform on finite groups.
  • Signal Processing: The DFT is central to digital signal processing, especially in filtering and frequency-domain analysis.

Conclusion

The Discrete Fourier Transform (DFT) is a versatile and powerful tool for analyzing discrete signals in terms of their frequency content. From breaking down complex signals into simpler components to enabling efficient signal processing, the DFT connects concrete, computational methods with deeper mathematical structures like linear algebra and harmonic analysis. By understanding the DFT in both practical and abstract terms, we gain insight into its wide-ranging applications in technology and science.