Python toolbox that incorporates tools from biological signal processing and musical theory to extract harmonic structures from biosignals.
🧬🎵 Visit the documentation page
To install the latest stable version of Biotuner from PyPI, run:
pip install biotuner
If you want the latest development version or contribute to the code, follow these steps:
The easiest way to set up a development environment is by using invoke
, which will:
✅ Create a Conda environment
✅ Install dependencies
✅ Install Biotuner in editable mode
# Clone the repository
git clone https://github.com/AntoineBellemare/biotuner.git
cd biotuner
# Install Invoke (if not already installed)
pip install invoke
# Automatically create a Conda environment and install Biotuner
invoke setup
👉 This will create a Conda environment named biotuner_env
and install all dependencies.
To activate the Conda environment manually:
conda activate biotuner_env
If you prefer to set up the environment manually, follow these steps:
conda create --name biotuner_env python=3.11 -y
conda activate biotuner_env
pip install -r requirements.txt
pip install -e .
To confirm that Biotuner is installed correctly, run the test suite:
invoke test
or manually using:
pytest tests/
If all tests pass ✅, your installation is complete!
- For general users: Install via
pip install biotuner
- For development: Clone the repo and run
invoke setup
- To verify installation: Run
invoke test
biotuning = biotuner(sf = 1000) #initialize the object
biotuning.peaks_extraction(data, peaks_function='FOOOF') #extract spectral peaks
biotuning.compute_peaks_metrics() #get consonance metrics for spectral peaks
The figure below illustrates Biotuner's ability to extract harmonic structures across different biological and physical systems. It showcases harmonic ratios detected in biosignals from the brain, heart, and plants, as well as their correspondence with audio signals. By analyzing the fundamental frequency relationships in these diverse modalities, Biotuner enables a cross-domain exploration of resonance and tuning in biological and artificial systems.