This project demonstrates high-performance parallel processing of audio signals using NVIDIA CUDA and cuFFT, implemented in C++ and compiled via nvcc
. The workflow automates the process of reading .wav
audio files, computing their Fast Fourier Transform (FFT) on the GPU, and outputting both time-domain and frequency-domain representations as plots using Python and Matplotlib.
The core idea is to showcase GPU-accelerated signal processing at scale, enabling fast and efficient transformation and visualization of audio data.
✅ GPU-based FFT using cuFFT
✅ Header-only WAV parsing (no external dependencies)
✅ Time and Frequency domain signal export
✅ Beautiful Python dual-domain plots
✅ Supports batch processing of multiple audio files
The CUDA component of the project loads audio samples into GPU memory and performs cuFFT on each signal buffer. Output is collected in CSV format for both:
- Time Domain: Raw waveform amplitude values
- Frequency Domain: FFT magnitudes for each frequency bin
Each audio sample is processed in parallel, making it scalable across multiple .wav
files.
The script/plot_signal.py
script generates side-by-side visualizations for each audio file:
- Time Domain: Shows a dynamic and expressive waveform with strong amplitude peaks—expected from a rich polyphonic piece.
- Frequency Domain: Captures broad harmonic content, dense frequency components indicating musical complexity.
- Time Domain: Sparse waveform with decaying low-frequency vibrations—typical for a bassline.
- Frequency Domain: Dominant low-end frequencies, validating expected frequency distribution for bass instruments.
- Clean and Compile the CUDA Project
make clean
make
- Run the Full Audio FFT Pipeline
bash run.sh
This step runs the compiled program, processes all audio .wav
files, and saves FFT output as .csv
files in the output/
directory.
- Plot All FFT Signals
make plot
This visualizes each signal’s time and frequency domains, saving PNG plots to the plot/
directory with names matching the original audio files.
You can also execute the full pipeline using:
./run.sh
This compiles, processes audio files, and generates plots in one go.
nvcc
cuFFT
matplotlib
numpy
sys
/os
Install Python dependencies via:
pip install matplotlib numpy
- Audio samples: DSPRelated Instruments Dataset
- Visualization: Matplotlib
- Powered by CUDA 🚀
Made by Aditi Saxena