A Flask web app for analyzing and comparing audio files using multiple spectral analysis methods and interactive visualization.
- Multiple Analysis Methods: FFT, CQT, Multi-Resolution, Chirplet Transform, and Wavelet-based approaches
- Interactive Web Interface: Upload audio files and configure analysis parameters
- Real-time Peak Detection: Automatic detection of spectral peaks with adjustable sensitivity
- Interactive Plotting: Click to select peaks, create harmonic pairs, and analyze frequency relationships
- Dual Scale Support: Toggle between linear and dB scales
- HTML Export: Generate standalone interactive HTML visualizations using Plotly
- Data Export: Save analysis results or plot images as CSV, JSON or JPG files
- Python 3.9 or higher, probably (developed and tested on Python 3.12.10)
- pip package manager
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/laelume/jellyfish_dynamite.git
cd jellyfish_dynamiteOr download ZIP:
- Click "Code" (top right) → "Download ZIP" on GitHub
- Extract and navigate to the folder
-
Create and activate virtual environment:
python -m venv venv
venv\Scripts\activate
source venv/bin/activate -
Install dependencies:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
-
Run the application:
python jelly_app.py
-
Open browser and go to:
http://localhost:5000 -
Analyze Audio
The test_audio/ folder contains sample audio files to test the application.
- Click "Choose Files"
- Navigate to the test_audio/ folder
- Select one or more test files
- Click "Analyze"
Option 1: Flask Web App Standalone
pip install -r requirements.txtOption 2: Flask + Jupyter Notebook Support
pip install -r requirements-jupyter.txtUse Case: Quick install, batch processing, easy file upload
python jelly_app.pyGo to http://localhost:5000
- Web-based file upload interface
- Parameter configuration through forms
- Automatic HTML generation and browser opening
Use Case: Low-level parameter adjustment, interactive development, data exploration
jupyter notebook# Import functions or use provided notebooks- Interactive matplotlib plots with full controls
- Step-by-step analysis workflow
- Iterative parameter adjustment
Use Case: Command-line use, automated processing, batch analysis
python jellyfish_plotly_browser.py# Analyzes files in specified directory- Direct file processing from directories
- Generates HTML output automatically
- No web server required
- Download Python 3.9+ from python.org
⚠️ Important: Check "Add Python to PATH" during installation
- Download this project as ZIP and extract it
- Double-click
jelly_roll.bat - Wait for installation (2-3 minutes)
- Open browser to http://localhost:5000 when ready
- Install Python 3.9+:
- Mac Option A: Download from python.org
- Mac Option B: Use Homebrew:
brew install python3 - Linux: Use package manager:
sudo apt install python3(Ubuntu) orsudo yum install python3(CentOS)
- Download this project as ZIP and extract it
- Open Terminal in the project folder
- IMPORTANT!!! Make script executable:
chmod +x jelly_roll.sh - Run the installer:
./jelly_roll.sh - Wait for installation (2-3 minutes)
- Open browser to http://localhost:5000 when ready
If the above doesn't work:
- Windows: Open Command Prompt in project folder, run the commands from "For Developers" section
- Mac/Linux: Open Terminal in project folder, run the commands from "For Developers" section
-
Clone or download the project files:
Option A: Using Git (Recommended)
git clone https://github.com/laelume/jellyfish_dynamite.git cd jellyfish_dynamiteOption B: Download ZIP
- Go to GitHub repo
- Click green "Code" button
- Select "Download ZIP"
- Extract ZIP file to desired location
- Open terminal/command prompt in extracted folder
-
Check Python version:
python --version # Should be 3.9 or higher -
Create virtual environment:
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Mac/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python jelly_app.py
-
Open browser and navigate to:
http://localhost:5000
-
Upload Audio Files
- Select one or more audio files (.wav, .mp3, .flac)
- Files are processed in the order uploaded
- More files + more methods = more laggy
-
Configure Analysis Parameters
- Analysis Methods: Choose from FFT, CQT, Multi-Res, Chirplet, Wavelet variants
- FFT Size (n_fft): Window size for spectral analysis (512, 1024, 2048, 4096)
- Peak Detection Range: Set frequency bounds for peak detection (Hz)
- Plot Display Range: Set frequency bounds for visualization (Hz)
- Scale: Choose between dB and linear amplitude scales
- Directory Name: Custom name for output files and save options
-
Submit Analysis
- Click "Analyze" to process files
- Results open automatically in browser
Once analysis is complete, use these controls in the interactive plot:
- Left Click: Select a spectral peak (blue dot with frequency label)
- Right Click: Create harmonic pair from last two selected peaks
- Double Click: Remove a peak or pair
- Triple Click (Left): Remove all peaks and pairs
- Triple Click (Right): Remove all pairs but keep peaks
- Ctrl+Click: Remove specific peak
- 1 - Select highest PSD peak for all subplots
- 2 - Select 2nd highest PSD peak for all subplots
- 3 - Select 3rd highest PSD peak for all subplots
- A - Auto-connect all points (creates fully-connected graph)
- L - Remove all connecting lines (keep selected peaks)
- C - Clear active / selected graph
- R - Reset all selected peaks and lines
- M - Show matrix analysis
- D - Toggled dB ↔ Linear scale
- Gray dots: Detected spectral peaks
- Blue dots: Selected peaks with frequency labels
- Colorful lines: Harmonic pairs with ratio information
- Dashed lines: Vertical reference lines at peak frequencies
- Top-right legend: Shows frequency pairs and their ratios
- FFT: Standard Fast Fourier Transform - best for general spectral analysis
- CQT: Constant-Q Transform - better frequency resolution at low frequencies
- Multi-Res: Multiple FFT window sizes - adaptive frequency resolution
- Chirplet: Chirplet transform - good for frequency-modulated signals
- Chirplet Zero: Zero-padded chirplet - enhanced for short signals
- Wavelet: Wavelet packet decomposition - time-frequency localization
- Improved Wavelet: Enhanced wavelet with better frequency mapping
- Stationary Wavelet: Shift-invariant wavelet transform
The application generates several output files:
- Interactive HTML: Standalone visualization with full interactivity
- Pair Data JSON: Frequency pairs and ratios for each file/method
- Graph Data JSON: Node and edge data for network analysis
- PNG Plots: Static matplotlib figures (if saved manually)
- CSV File: Simple CSV with selected peaks and ratios of peak frequencies
Set these in environment or modify config.py:
export UPLOAD_FOLDER="uploads"
export MAX_CONTENT_LENGTH= 100 * 1024 * 1024 # 100MB max file size
export NFFT=1024 # Default FFT size
export PEAK_FMIN=100 # Default peak detection minimum (Hz)
export PEAK_FMAX=5000 # Default peak detection maximum (Hz)
export PLOT_FMIN=100 # Default plot minimum (Hz)
export PLOT_FMAX=5000 # Default plot maximum (Hz)Edit these in config.py:
DEFAULT_METHODS = ["FFT", "Chirplet Zero"]
DEFAULT_N_FFT = 1024
DEFAULT_PEAK_FMIN = 100
DEFAULT_PEAK_FMAX = 5000
MAX_PAIRS = 10For programmatic use, import the core functions:
from jellyfish_plotly_browser import compare_methods_psd_analysis, save_jellyfish_plotly
# Run analysis
fig, plots, save_func, dir_name = compare_methods_psd_analysis(
audio_directory="path/to/audio/files",
methods=["FFT", "CQT"],
n_fft=1024,
peak_fmin=100,
peak_fmax=5000,
use_db_scale=True
)
# Generate interactive HTML
html_path, data_path, graph_path = save_jellyfish_plotly(
plots,
base_filename="analysis_file",
dir_name="favorite_animal",
use_db_scale=True
)-
"Python is not recognized" or "python: command not found"
- Install Python 3.9+ from python.org
- On Windows: Check "Add Python to PATH" during installation
- Restart command prompt/terminal after installation
-
"No module named..." errors
- Make sure virtual environment is activated:
venv\Scripts\activate - Install missing packages:
pip install -r requirements.txt
- Make sure virtual environment is activated:
-
"Python version too old" error
- Python version is below 3.9
- Update Python from python.org
-
File upload fails
- Check file size (default limit: 100MB)
- Ensure audio format is supported (.wav, .mp3, .flac)
-
Browser doesn't open automatically
- Manually navigate to http://localhost:5000
- Check console output for any error messages
-
Interactive features not working in HTML
- Ensure JavaScript is enabled in browser
- Try refreshing the page
- Check browser console (F12) for JavaScript errors
- Use smaller FFT sizes (512, 1024) for faster processing
- Limit the number of analysis methods for large files
- Reduce frequency ranges for peak detection to improve speed
- Process files in smaller batches for memory efficiency
- Check that all requirements are installed:
pip list - Verify Python version:
python --version(should be 3.9+) - Test with smaller audio files first
- Check browser console for JavaScript errors (F12)
Process multiple files with consistent parameters:
selected_files = select_audio_files(
directory_path="audio_samples/",
range_start=0,
range_end=10, # Process first 10 files
extensions=('.wav', '.mp3')
)Adjust sensitivity parameters:
# More sensitive peak detection
height_percentile=0.3 # Lower threshold
prominence_factor=0.02 # Less prominence required
min_width=0.1 # Narrower peaks allowed
# Less sensitive peak detection
height_percentile=0.8 # Higher threshold
prominence_factor=0.1 # More prominence required
min_width=2.0 # Wider peaks onlyThe tool creates network graphs of harmonic relationships. Access graph data:
for plot in plots:
graph_data = plot.get_graph_data()
print(f"Nodes: {len(graph_data['nodes'])}")
print(f"Edges: {len(graph_data['edges'])}")Copyright 2025-2026 by laelume aka Ashlae Blum'e. Licensed under GPL 3.0.
For issues and questions:
- Check the troubleshooting section above
- Verify all dependencies are installed correctly
- Test with smaller audio files first
- Check browser console for JavaScript errors (F12)
- Message me!