Skip to main content

Spafe

Simplified Python Audio Features Extraction

Build Status docs.rs License Python codecov codebeat badge PyPI version anaconda Downloads DOI DOI

Table of Contents

Structure

spafe aims to simplify feature extractions from mono audio files. Spafe includes various computations related to filter banks, spectrograms, frequencies and cepstral features . The library has the following structure:

Filter banks

  • Bark filter banks
  • Gammatone filter banks
  • Linear filter banks
  • Mel filter banks

Spectrograms

  • Bark spectrogram
  • CQT spectrogram
  • Erb spectrogram
  • Mel spectrogram

Features

  • Bark Frequency Cepstral Coefficients (BFCCs)
  • Constant Q-transform Cepstral Coefficients (CQCCs)
  • Gammatone Frequency Cepstral Coefficients (GFCCs)
  • Linear Frequency Cepstral Coefficients (LFCCs)
  • Linear Prediction Components (LPCs)
  • Mel Frequency Cepstral Coefficients (MFCCs)
  • Inverse Mel Frequency Cepstral Coefficients (IMFCCs)
  • Magnitude based Spectral Root Cepstral Coefficients (MSRCCs)
  • Normalized Gammachirp Cepstral Coefficients (NGCCs)
  • Power-Normalized Cepstral Coefficients (PNCCs)
  • Phase based Spectral Root Cepstral Coefficients (PSRCCs)
  • Perceptual Linear Prediction Coefficents (PLPs)
  • Rasta Perceptual Linear Prediction Coefficents (RPLPs)

The theory behind features computed using spafe can be summmarized in the following graph:

Frequencies

  • Dominant frequencies
  • Fundamental frequencies

Installation

Dependencies

spafe requires:

if you want to use the visualization module/ functions of spafe, you will need to install:

Installation guide

Once you have the Dependencies installed, use one of the following install options.

Install from PyPI

  • To freshly install spafe:
pip install spafe
  • To update an existing installation:
pip install -U spafe

Install from Anaconda

  • Spafe is also available on anaconda:
conda install spafe

Install from source

  • You can build spafe from source, by following:
git clone git@github.com:SuperKogito/spafe.git
cd spafe
python setup.py install

Why use Spafe?

Unlike most existing audio feature extraction libraries (python_speech_features, SpeechPy, surfboard and Bob), Spafe provides more options for spectral features extraction algorithms, notably:

  • Bark Frequency Cepstral Coefficients (BFCCs)
  • Constant Q-transform Cepstral Coefficients (CQCCs)
  • Gammatone Frequency Cepstral Coefficients (GFCCs)
  • Power-Normalized Cepstral Coefficients (PNCCs)
  • Phase based Spectral Root Cepstral Coefficients (PSRCCs)

Most existing libraries and to their credits provide great implementations for features extraction but are unfortunately limited to the Mel Frequency Features (MFCC) and at best have Bark frequency and linear predictive coefficients additionally. Librosa for example includes great implementation of various algorithms (only MFCC and LPC are included), based on the Short Time Fourrier Transform (STFT), which is theoretically more accurate but slower than the Discret Fourrier Transform used in Spafe's implementation.

How to use

Various examples on how to use spafe are present in the documentation https://superkogito.github.io/spafe.

!Please make sure you are referring to the correct documentation version.

Contributing

Contributions are welcome and encouraged. To learn more about how to contribute to spafe please refer to the Contributing guidelines

Citing

  • If you want to cite spafe as a software, please cite the version used as indexed in Zenodo:

    Ayoub Malek, Hadrien Titeux, Stefano Borzì, Christian Heider Nielsen, Fabian-Robert Stöter, Hervé Bredin, Eryk Urbański & Kevin Mattheus Moerman. (2023). SuperKogito/spafe: v0.3.3 (v0.3.3). Zenodo. https://doi.org/10.5281/zenodo.11396240

    DOI

  • You can also site spafe's paper as follows:

    Malek, A., (2023). Spafe: Simplified python audio features extraction. Journal of Open Source Software, 8(81), 4739, https://doi.org/10.21105/joss.04739

    DOI

Metadata

Release files for spafe 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spafe 0.3.3
File Size Uploaded
spafe-0.3.3.tar.gz 51.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spafe 0.3.3
File Interpreter ABI Platform
spafe-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 145.3 kB

Release files / spafe-0.3.3.tar.gz

Download URL spafe-0.3.3.tar.gz
Size 51.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fc3034d8d74a3034decdf91cf6c81a07f4f13518e84d1a49503da0263ba4e760
BLAKE2b-256 checksum
How to use checksums
3ceb86c0433f98b56870bd4a9548463ffa054302f01f6ca75151b7d364a1da7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release files / spafe-0.3.3-py3-none-any.whl

Download URL spafe-0.3.3-py3-none-any.whl
Size 94.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82411686678ee57dd2aacbf20e0f2c41debf34a574fb3503b98ff609e1847d2a
BLAKE2b-256 checksum
How to use checksums
7eb57c18d2faac033b928b872a4d69d5c9933c8946dc1df9007ad0f659924fed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

3 release files

0.3.1

3 release files

0.3.0

3 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page