Skip to content

About

This project implements large-scale waveform generation, feature extraction, and clustering with GPU acceleration using CUDA via the RAPIDS suite (cuDF, cuML, cuPy). The system automatically falls back to CPU processing when GPU resources are unavailable.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CUDA-Accelerated Waveform Analysis

Overview

This project implements large-scale waveform generation, feature extraction, and clustering with GPU acceleration using CUDA via the RAPIDS suite (cuDF, cuML, cuPy). The system automatically falls back to CPU processing when GPU resources are unavailable.

Features

  • GPU Acceleration: Utilizes NVIDIA RAPIDS libraries for accelerated data processing
  • Automatic Fallback: Gracefully reverts to CPU processing when GPU is unavailable
  • Waveform Generation: Creates synthetic waveforms with complex parameter combinations
  • Feature Extraction: Computes time and frequency domain features from waveforms
  • Dimensionality Reduction: Implements PCA for feature compression
  • Clustering: Groups similar waveforms using K-means
  • Visualization: Generates comprehensive plots to analyze clusters and feature importance

Requirements

  • Python 3.6+
  • NumPy, Pandas, Matplotlib, Seaborn, SciPy, scikit-learn
  • TQDM (for progress bars)
  • Optional GPU dependencies:
    • NVIDIA GPU with CUDA support
    • RAPIDS suite (cuDF, cuML, cuPy)

Installation

# Install Python 3.12 if not already available
sudo dnf install python3.12 python3.12-devel

# Create virtual environment with Python 3.12
python3.12 -m venv ~/venvs/rapids_env
source ~/venvs/rapids_env/bin/activate

# Install dependencies
pip install --upgrade pip
pip install numpy pandas matplotlib seaborn scikit-learn scipy tqdm

# Install CuPy for CUDA 12.x (since you have CUDA 13.0, use cu12x)
pip install cupy-cuda12x

# Install RAPIDS for CUDA 12
pip install --extra-index-url=https://pypi.nvidia.com cudf-cu12 cuml-cu12

Usage

Simply run the main script:

python pipeline.py

The script will:

  1. Check for GPU availability and inform the user
  2. Generate a diverse dataset of synthetic waveforms
  3. Extract features from each waveform
  4. Perform dimensionality reduction and clustering
  5. Generate visualizations and analysis
  6. Save results to the cuda_waveform_analysis directory

Output Structure

cuda_waveform_analysis/
├── all_waveform_features.csv   # Raw feature data
├── X_pca.npy                   # PCA-transformed features
├── kmeans_labels.npy           # Cluster assignments
├── cluster_centers.npy         # Cluster centroids
├── cluster_parameters.csv      # Mapping of clusters to parameters
└── plots/
    ├── kmeans_clusters_tsne.png           # t-SNE visualization of clusters
    ├── cluster_*_distribution.png         # Parameter distributions by cluster
    ├── feature_importance.png             # Top features for cluster separation
    ├── cluster_representative_waveforms_*.png  # Example waveforms from each cluster
    ├── largest_clusters_waveforms.png     # Waveforms from most common clusters
    ├── parameter_relationship.png         # Relationship between parameters
    └── parameter_cluster_correlation.png  # Correlation heatmap

Implementation Details

Waveform Generation

The system generates complex waveforms by combining sine, square, triangle, and sawtooth waves with various frequency parameters. Latin Hypercube Sampling ensures efficient parameter space coverage.

Cluster Samples: cluster_016_samples_5x1

Feature Extraction

For each waveform, the system extracts:

  • Basic statistics (mean, standard deviation, range)
  • Signal characteristics (zero crossings, peak count)
  • Statistical moments (skewness, kurtosis)
  • Complexity measures (total variation)
  • Frequency domain features (spectral bands, dominant frequency)

Dimensionality Reduction and Clustering

The high-dimensional feature space is reduced using PCA (Principal Component Analysis), then clustered using K-means to identify similar waveform patterns. t-SNE (t-Distributed Stochastic Neighbor Embedding) is used for visualization purposes. tsne_overview

Actual Physical Replication of Computed EMFs using Frequency Multiplyer

Taking the dimensions given from the discovery model, we can replicate these waveforms in a tanglible way. SsfnEx4y

Performance Considerations

  • Memory usage scales with the number of waveforms and features
  • Batch processing helps manage memory constraints
  • GPU acceleration provides significant speedup for large datasets
  • The code automatically adjusts batch sizes based on available resources

Extending the Project

  • Add new waveform generation functions
  • Implement additional feature extraction methods
  • Experiment with different clustering algorithms
  • Export identified clusters for use in audio synthesis or signal processing applications

About

This project implements large-scale waveform generation, feature extraction, and clustering with GPU acceleration using CUDA via the RAPIDS suite (cuDF, cuML, cuPy). The system automatically falls back to CPU processing when GPU resources are unavailable.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages