Skip to main content
Login | Suomeksi | På svenska | In English

Browsing by Subject "C++20"

Sort by: Order: Results:

  • Yliluoma, Joel (2024)
    In this thesis we study how to implement the one-dimensional fast Fourier transform (FFT) as a computer program in such a way that it works fast on inputs of all sizes. First we walk through the mathematical theory behind the continuous and the discrete Fourier transform (DFT), and study the motivation behind them. We explore both the one-dimensional and the multi-dimensional versions of the DFT. We also study the discrete cosine transform (DCT) and explore its differences to the Fourier transform. After that, we explore various known methods for implementing the fast Fourier transform. We focus especially on the Cooley-Tukey algorithm and its different forms in enough detail, that one can understand both how it works and how it was conceived. We also explore Rader’s and Bluestein’s FFT algorithms. After the theory we implement the DFT and the FFTs using the C++ programming language. We also devise and implement a combined algorithm, which seeks to provide the fastest possible transformation by choosing the optimal combination of algorithms in each case. We use C++20, which is the most recent standard version of C++ at the time of writing. We analyze the speed of the implemented methods, comparing them against each others and also compared to a famous FFT library, FFTW. In addition, we analyze the numeric accuracy of the implementations. Then we analyze the accuracy and applicability of the analysis methods and study the shortcomings and possible approaches for improving the implementations. We also present a simple example application of FFT, where the program attempts to identify the vowel sounds present in a voice sample. The purpose of this thesis is to offer the reader a clear example implementation of all the presented transforms and to thoroughly explore their limitations, weaknesses and strengths. For best value, the reader is expected to understand the basics of calculus and the basics of complex numbers. Especially the sum notation, ∑, and Euler’s formula are vital for understanding the mathematical theory. The computer source code is designed in such way that the reader does not need to know the details of the C++20 standard, or indeed even the C++ language, but experience in C programming will help.