Discrete Fourier Transform (DFT)
Discrete Fourier Transform (DFT) is a mathematical transformation that transforms a sequence of complex numbers into another sequence of complex numbers.
The DFT of a sequence is defined as:
- is an th primitive root of unity,
- DFT is a linear transformation that can be represented by a matrix multiplication of the DFT matrix and the sequence
- The DFT matrix with is defined as: for
- Inverse DFT (IDFT):
- The DFT matrix is invertible and its inverse is the Inverse DFT (IDFT) matrix:
- Since is a primitive th root of unity, then is also a primitive th root of unity
Fast Fourier Transform (FFT)
-
A polynomial can be written as where:
- and are the even and odd parts of and their degrees are
-
Fast Fourier Transform (FFT) is an algorithm that computes the Discrete Fourier Transform (DFT) of a sequence, or its inverse (IDFT).
-
Input:
- Coefficients of a polynomial of degree
- must be a power of
- is an th primitive root of unity
- Coefficients of a polynomial of degree
-
Algorithm:
- Evaluate at the even powers of
- Evaluate at the even powers of
- Compute for
- Return the values
-
Time Complexity:
Inverse FFT (IFFT)
-
To perform inverse DFT (IDFT), we can perform
-
DFT
-
using in FFT for set of sums of elements in A and in B https://stackoverflow.com/questions/58345813/how-to-find-all-sums-of-two-sets-in-onlogn-time-arithmetic-and-comparisons