Skip to main content

Simplified Python Audio-Features Extraction.

Project description

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. (2023). SuperKogito/spafe: Spafe: Simplified python audio features extraction (v0.3.1). Zenodo. https://doi.org/10.5281/zenodo.7533946

    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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spafe-0.3.2.tar.gz (50.4 kB view details)

Uploaded Source

Built Distributions

spafe-0.3.2-py3.8.egg (201.5 kB view details)

Uploaded Source

spafe-0.3.2-py3-none-any.whl (93.5 kB view details)

Uploaded Python 3

File details

Details for the file spafe-0.3.2.tar.gz.

File metadata

  • Download URL: spafe-0.3.2.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for spafe-0.3.2.tar.gz
Algorithm Hash digest
SHA256 46eb77e44dec1951f0f01f863bfe6420519860e8e312ed57ed713bac66823b5a
MD5 2ef2fc742614907d8d160666cf99b74d
BLAKE2b-256 b28acbd93b4b566201231aec81caf688a7c7f9e4432339841e84b4ce2a8d26f4

See more details on using hashes here.

Provenance

File details

Details for the file spafe-0.3.2-py3.8.egg.

File metadata

  • Download URL: spafe-0.3.2-py3.8.egg
  • Upload date:
  • Size: 201.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for spafe-0.3.2-py3.8.egg
Algorithm Hash digest
SHA256 96b99bfc08b4ee1d19c7d99491f6f24562a188ac5f3acd2ad4b5f3eb847f9a73
MD5 d8b8ac91567e8d61a0f8851c037daba2
BLAKE2b-256 e2b9b45384c7b2837e9524e7456c9580995d0b0779a1a557df4703c7af565296

See more details on using hashes here.

Provenance

File details

Details for the file spafe-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: spafe-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 93.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for spafe-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 195ccddf5c0692ee8c5691bea06c1bc224ac31c0e5937099b8ea89b87a24bd7e
MD5 fd122ef628e2907b994548e7846bf0ce
BLAKE2b-256 3c0710707dae2f307fdcc3c41f28c22dfd3e3d4130b92fe32fc078838814710b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page