pENC is a high-performance, hybrid C++/Python audio processing toolkit designed for large-scale, parallel feature extraction and classification of audio files. It leverages OpenCL for GPU acceleration, Cython for CPU parallelism, and Python for orchestration and machine learning, making it ideal for research and production environments where speed and flexibility are critical.
- Blazing Fast MFCC Extraction: Utilizes clFFT and OpenCL for GPU-accelerated FFT and power spectrum computation.
- Cython and C++ Hybrid: Seamlessly switches between Cython (CPU) and C++/OpenCL (GPU) for optimal performance.
- Batch Audio Processing: Efficiently processes thousands of audio files with minimal CPU and GPU idle time.
- Custom OpenCL Kernels: Includes custom kernels for Hamming window, mel filterbank, and DCT operations.
- Python Orchestration: Easy-to-use Python interface for feature extraction, model training, and evaluation.
- Machine Learning Ready: Integrates with scikit-learn for training and evaluating classifiers.
- Flexible Build System: CMake-based build with Visual Studio and CMake Tools extension support.
- Extensive Dataset Support: Designed to handle large datasets with robust error handling and caching.
pENC/
├── classifier.py # Main Python script for feature extraction and classification
├── mfcc_extractor.cpp # C++/OpenCL backend for MFCC extraction
├── mfcc_kernel.cl # OpenCL kernels for DSP operations
├── logic.py, shortcut.py # Supporting Python modules
├── setup.py # Cython build script
├── CMakeLists.txt # CMake build configuration
├── dataset/ # Audio dataset and metadata
├── build/ # Build artifacts
├── LICENSE # License file
└── README.md # This file
- Python 3.13
- Cython
- OpenCL 2.0+ compatible GPU (tested on Intel UHD Graphics 600)
- clFFT library (for GPU FFT)
- Visual Studio 2022 (for C++/CMake build)
- scikit-learn, numpy, pandas, soundfile, joblib (Python dependencies)
-
Install Python 3.13 and dependencies:
pip install cython numpy pandas scikit-learn soundfile joblib
-
Install clFFT:
- Download from clFFT GitHub
- Extract and add
clFFT/binto your PATH or useos.add_dll_directoryin Python (already handled inclassifier.py)
-
Build C++/Cython extensions:
-
Use the CMake Tools extension in VS Code or run:
cmake -S . -B build cmake --build build --config Release
-
-
Place your audio files and metadata in the
dataset/directory. -
Run the main pipeline:
python classifier.py
-
The script will extract MFCC features, train a classifier, and report accuracy.
- Switch between Debug/Release DLLs: The Python code automatically selects the correct DLL based on how you run (F5 for Debug, Ctrl+F5 for Release).
- Add new features: Extend
mfcc_extractor.cppormfcc_kernel.clfor custom DSP operations. - Dataset: Update
dataset/Classifier.csvand place audio files indataset/classifier/.
This project is licensed to Sayed Arham Abbas Rizvi, 2025. See LICENSE for details.
Developed by Sayed Arham Abbas Rizvi. For research and private use only.