This repository contains a C++/CLI application implementing the Discrete Fourier Transform (DFT) algorithm. The project serves as a benchmark tool to demonstrate the efficiency of parallel computing by comparing a custom CUDA-based implementation against a standard sequential CPU approach.
The core objective of this project is to implement the mathematical model of Harmonic Decomposition and Signal Reconstruction using two distinct architectural approaches:
-
CPU Backend: A classic sequential implementation of the DFT algorithm with
$O(N^2)$ computational complexity. - GPU Backend: A parallel implementation where the summation logic is executed on NVIDIA GPU cores using custom CUDA kernels.
Note: This project implements the direct DFT summation logic manually to demonstrate the SIMT architecture principles, rather than relying on optimized libraries like cuFFT.
The solution is modular and consists of three main components:
fourier-cpu-lib.dll: Native C++ library for sequential execution.fourier-lib.dll: CUDA C++ library containing GPU kernels and memory management logic.fourier-ui.exe: A Windows Forms (C++/CLI) GUI client that consumes both libraries to visualize results and measure execution time.
Developers can use the compiled DLLs to integrate the computational logic into their own custom clients.
The application does not process real-time signals. Instead, it operates on generated datasets based on user-defined parameters:
-
Configuration: The user defines the function range
$[a, b]$ , the number of discretization points ($N_e$ ), and the number of harmonics ($N_g$ ). -
Calculation: The system computes the Fourier coefficients (
$a_k, b_k$ ) and reconstructs the function$Y(t)$ . - Benchmarking: The application measures the precise execution time (in milliseconds) for both CPU and GPU to calculate the Speedup factor.
- Visualization: Results are plotted on a static graph for verification.
Pre-built binaries for Windows are available for testing:
- Navigate to the Releases section.
- Download the latest archive.
- Extract the contents.
- Run
fourier-ui.exe.
- IDE: Microsoft Visual Studio (any version that supports CUDA toolkit).
- Workloads: Desktop development with C++; C++/CLI support.
- SDK: NVIDIA CUDA Toolkit (v11.8+).
- Hardware: NVIDIA GPU with Compute Capability 3.5+.
- Clone the repository:
git clone https://github.com/the-darkkk/fourier-cuda
- Open
fourier-cuda.slnin Visual Studio. - Ensure the configuration is Release / x64.
- Build the solution (hit Ctrl+Shift+B).
This project is distributed under the GPL-3.0 License. See the LICENSE file for more information.
