Chapter 7. Discrete Fourier Transform
Weâve been using the Discrete Fourier Transform (DFT) since Chapter 1, but I havenât explained how it works. Now is the time.
If you understand the Discrete Cosine Transform (DCT), you will understand the DFT. The only difference is that instead of using the cosine function, weâll use the complex exponential function. Iâll start by explaining complex exponentials, then weâll follow the same progression as in Chapter 6:
Weâll start with the synthesis problem: given a set of frequency components and their amplitudes, how can we construct a signal? The synthesis problem is equivalent to the inverse DFT.
Then weâll rewrite the synthesis problem in the form of matrix multiplication using NumPy arrays.
Next weâll solve the analysis problem, which is equivalent to the DFT: given a signal, how do we find the amplitude and phase offset of its frequency components?
Finally, weâll use linear algebra to find a more efficient way to compute the DFT.
The code for this chapter is in chap07.ipynb
, which is in the repository for this book (see âUsing the Codeâ). You can also view it at http://tinyurl.com/thinkdsp07.
Complex Exponentials
One of the more interesting moves in mathematics is the generalization of an operation from one type to another. For example, a factorial is a function that operates on integers; the natural definition for the factorial of n is the product of all integers from 1 to n.
If you are of a certain inclination, ...
Get Think DSP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.