This repository contains Jupyter notebooks designed for the analysis of sound waves, audio, and music. The notebooks aim to facilitate research and development in Digital Signal Processing (DSP), Music Information Retrieval (MIR), and other sound-related fields. These tools are suitable for AI experts, data scientists, and engineers with a focus on audio signal processing.
The Sound Analysis Notebooks provide a comprehensive suite of tools for analysing various aspects of sound and music. These notebooks cover topics ranging from basic waveform analysis to advanced MIR techniques. The goal is to offer an accessible platform for both educational and professional purposes.
Before you begin, ensure you have the following installed on your machine:
- Python 3.7 or higher: Required for running the hooks and other project dependencies.
- Jupyter Notebook: Necessary for working with
.ipynb
files. - Anaconda distribution (Recommended): Simplifies package management and deployment.
- pre-commit: To enable and run the pre-commit hooks.
-
Install Python 3.8 or higher, preferably 3.11:
- Download and install the latest version of Python from python.org.
-
Install Anaconda (Recommended):
- Download and install Anaconda from anaconda.com.
-
Install Jupyter Notebook:
- If you have Anaconda installed, Jupyter Notebook is included. If not, install it using pip:
pip install notebook
- If you have Anaconda installed, Jupyter Notebook is included. If not, install it using pip:
-
Install pre-commit:
- Install pre-commit globally using pip:
pip install pre-commit
- Install pre-commit globally using pip:
-
Clone the Repository:
git clone <repository_url> cd <repository_directory>
-
Install the Pre-commit Hooks:
- Run the following command to install the pre-commit hooks specified in the
.pre-commit-config.yaml
file:pre-commit install
- Run the following command to install the pre-commit hooks specified in the
-
Run Pre-commit Hooks Manually (Optional):
- To run the pre-commit hooks on all files manually, use:
pre-commit run --all-files
- To run the pre-commit hooks on all files manually, use:
The project is configured to use the following pre-commit hooks:
- Bandit: Checks Python code for security issues.
- Black: Formats Python code to adhere to PEP 8.
- End-of-file Fixer: Ensures files end with a newline.
- Flake8: Lints Python code for style and quality.
- nbstripout: Strips output from Jupyter Notebooks to keep diffs clean.
- Pyupgrade: Upgrades syntax for newer versions of Python.
- Trailing Whitespace: Ensures no trailing whitespace.
- YAML Check: Checks for valid YAML syntax.
-
Clone the repository:
git clone https://github.com/yourusername/sound-analysis-notebooks.git
-
Navigate to the project directory:
cd sound-analysis-notebooks
-
Create a virtual environment:
python -m venv venv source venv/bin/activate
or on Windows:
python -m venv venv source venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.yaml
To start using the notebooks:
-
Activate the virtual environment if not already activated:
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
or on Windows:
source venv\Scripts\activate
-
Launch Jupyter Notebook:
jupyter notebook
-
Open and run the desired notebook from the Jupyter interface.
- Amplitude Envelope (AE): The amplitude envelope is a representation of how the amplitude (or loudness) of an audio signal changes over time. It is derived from the audio waveform by tracking the peaks of the signal's absolute amplitude over short time intervals, creating a smooth curve that outlines the overall shape of the sound. The amplitude envelope is useful in various audio analysis tasks, including identifying the temporal structure of a sound, detecting transient events, and distinguishing between different types of audio signals based on their dynamic characteristics.
We welcome contributions from the community. If you wish to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add a feature'
). - Push to the branch (
git push origin feature/branch
). - Open a pull request.