spafe


Namespafe JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/SuperKogito/spafe
SummarySimplified Python Audio-Features Extraction.
upload_time2023-01-13 02:00:20
maintainerAyoub Malek
docs_urlNone
authorAyoub Malek
requires_python
licenseBSD
keywords audio processing features extraction
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![](https://github.com/SuperKogito/spafe/blob/master/media/logo.png?raw=true)

# Spafe

Simplified Python Audio Features Extraction

[![Build Status](https://github.com/SuperKogito/spafe/actions/workflows/ci.yml/badge.svg)](https://github.com/SuperKogito/spafe/actions)
[![docs.rs](https://img.shields.io/docsrs/docs)](https://superkogito.github.io/spafe/)
[![License](https://img.shields.io/badge/license-BSD%203--Clause%20License%20(Revised)%20-blue)](https://github.com/SuperKogito/spafe/blob/master/LICENSE)
[![Python](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)](https://www.python.org/doc/versions/)
[![codecov](https://codecov.io/gh/SuperKogito/spafe/branch/master/graph/badge.svg)](https://codecov.io/gh/SuperKogito/spafe)
[![codebeat badge](https://codebeat.co/badges/97f81ec3-b8a3-42ff-a9f5-f6cf165f4448)](https://codebeat.co/projects/github-com-superkogito-spafe-master)
[![PyPI version](https://badge.fury.io/py/spafe.svg)](https://badge.fury.io/py/spafe)
[![anaconda](https://anaconda.org/superkogito/spafe/badges/version.svg)](https://anaconda.org/SuperKogito/spafe)
[![Downloads](https://pepy.tech/badge/spafe)](https://pepy.tech/project/spafe)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6824667.svg)](https://doi.org/10.5281/zenodo.6824667)


#  Table of Contents

- [Structure](#Structure)
  - [Filter banks](#Filter-banks)
  - [Spectrograms](#Spectrograms)
  - [Features](#Features)
  - [Frequencies](#Frequencies)
- [Installation](#Installation)
  - [Dependencies](#Dependencies)
  - [Installation guide](#Installation-guide)
- [How to use](#How-to-use)
- [Contributing](#Contributing)
- [Citing](#Citing)

# 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:
![](https://github.com/SuperKogito/spafe/raw/master/media/spafe-structure.png)

## Filter banks
![](https://github.com/SuperKogito/spafe/blob/master/media/bark_fbanks.png?raw=true)
  - Bark filter banks
  - Gammatone filter banks
  - Linear filter banks
  - Mel filter banks

## Spectrograms
![](https://github.com/SuperKogito/spafe/blob/master/media/melspectrogram.png?raw=true)  
  - Bark spectrogram
  - CQT spectrogram
  - Erb spectrogram
  - Mel spectrogram

## Features
![](https://github.com/SuperKogito/spafe/blob/master/media/gfcc.png?raw=true)
  - 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:
![](https://github.com/SuperKogito/spafe/blob/master/media/features-extraction-algorithms.png?raw=true)

## Frequencies
![](https://github.com/SuperKogito/spafe/blob/master/media/dominant_frequencies.png?raw=true)
  - Dominant frequencies
  - Fundamental frequencies

## Installation
### Dependencies

spafe requires:

-	[Python](https://www.python.org/) (>= 3.5)
-	[NumPy](https://numpy.org/) (>= 1.22.0)
-	[SciPy](https://scipy.org/) (>= 1.8.0)

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

- [Matplotlib](https://matplotlib.org/) (>= 3.5.2)


### 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](https://github.com/jameslyons/python_speech_features), [SpeechPy](https://github.com/astorfi/speechpy), [surfboard](https://github.com/novoic/surfboard) and [Bob](https://gitlab.idiap.ch/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](https://github.com/librosa/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](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](https://github.com/SuperKogito/spafe/blob/master/CONTRIBUTING.md)

## Citing

-  If you want to cite spafe as a software used in your work, please
   cite the version used as indexed at [Zenodo](https://zenodo.org/):
   [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6824667.svg)](https://doi.org/10.5281/zenodo.6824667)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SuperKogito/spafe",
    "name": "spafe",
    "maintainer": "Ayoub Malek",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "superkogito@gmail.com",
    "keywords": "audio processing,features extraction",
    "author": "Ayoub Malek",
    "author_email": "superkogito@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a4/d5/57e0cef4a1716180451420a06e5393f2c7113b9f1d5dbad7d0551cec3986/spafe-0.3.1.tar.gz",
    "platform": "any",
    "description": "![](https://github.com/SuperKogito/spafe/blob/master/media/logo.png?raw=true)\n\n# Spafe\n\nSimplified Python Audio Features Extraction\n\n[![Build Status](https://github.com/SuperKogito/spafe/actions/workflows/ci.yml/badge.svg)](https://github.com/SuperKogito/spafe/actions)\n[![docs.rs](https://img.shields.io/docsrs/docs)](https://superkogito.github.io/spafe/)\n[![License](https://img.shields.io/badge/license-BSD%203--Clause%20License%20(Revised)%20-blue)](https://github.com/SuperKogito/spafe/blob/master/LICENSE)\n[![Python](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)](https://www.python.org/doc/versions/)\n[![codecov](https://codecov.io/gh/SuperKogito/spafe/branch/master/graph/badge.svg)](https://codecov.io/gh/SuperKogito/spafe)\n[![codebeat badge](https://codebeat.co/badges/97f81ec3-b8a3-42ff-a9f5-f6cf165f4448)](https://codebeat.co/projects/github-com-superkogito-spafe-master)\n[![PyPI version](https://badge.fury.io/py/spafe.svg)](https://badge.fury.io/py/spafe)\n[![anaconda](https://anaconda.org/superkogito/spafe/badges/version.svg)](https://anaconda.org/SuperKogito/spafe)\n[![Downloads](https://pepy.tech/badge/spafe)](https://pepy.tech/project/spafe)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6824667.svg)](https://doi.org/10.5281/zenodo.6824667)\n\n\n#  Table of Contents\n\n- [Structure](#Structure)\n  - [Filter banks](#Filter-banks)\n  - [Spectrograms](#Spectrograms)\n  - [Features](#Features)\n  - [Frequencies](#Frequencies)\n- [Installation](#Installation)\n  - [Dependencies](#Dependencies)\n  - [Installation guide](#Installation-guide)\n- [How to use](#How-to-use)\n- [Contributing](#Contributing)\n- [Citing](#Citing)\n\n# Structure\nspafe aims to simplify feature extractions from **mono audio** files.\nSpafe includes various computations related to filter banks, spectrograms, frequencies and cepstral features .\nThe library has the following structure:\n![](https://github.com/SuperKogito/spafe/raw/master/media/spafe-structure.png)\n\n## Filter banks\n![](https://github.com/SuperKogito/spafe/blob/master/media/bark_fbanks.png?raw=true)\n  - Bark filter banks\n  - Gammatone filter banks\n  - Linear filter banks\n  - Mel filter banks\n\n## Spectrograms\n![](https://github.com/SuperKogito/spafe/blob/master/media/melspectrogram.png?raw=true)  \n  - Bark spectrogram\n  - CQT spectrogram\n  - Erb spectrogram\n  - Mel spectrogram\n\n## Features\n![](https://github.com/SuperKogito/spafe/blob/master/media/gfcc.png?raw=true)\n  - Bark Frequency Cepstral Coef\ufb01cients (BFCCs)\n  - Constant Q-transform Cepstral Coe\ufb03cients (CQCCs)\n  - Gammatone Frequency Cepstral Coef\ufb01cients (GFCCs)\n  - Linear Frequency Cepstral Coef\ufb01cients (LFCCs)\n  - Linear Prediction Components (LPCs)\n  - Mel Frequency Cepstral Coef\ufb01cients (MFCCs)\n  - Inverse Mel Frequency Cepstral Coef\ufb01cients (IMFCCs)\n  - Magnitude based Spectral Root Cepstral Coefficients (MSRCCs)\n  - Normalized Gammachirp Cepstral Coefficients (NGCCs)\n  - Power-Normalized Cepstral Coefficients (PNCCs)\n  - Phase based Spectral Root Cepstral Coefficients (PSRCCs)\n  - Perceptual Linear Prediction Coefficents (PLPs)\n  - Rasta Perceptual Linear Prediction Coefficents (RPLPs)\n\nThe theory behind features computed using spafe can be summmarized in the following graph:\n![](https://github.com/SuperKogito/spafe/blob/master/media/features-extraction-algorithms.png?raw=true)\n\n## Frequencies\n![](https://github.com/SuperKogito/spafe/blob/master/media/dominant_frequencies.png?raw=true)\n  - Dominant frequencies\n  - Fundamental frequencies\n\n## Installation\n### Dependencies\n\nspafe requires:\n\n-\t[Python](https://www.python.org/) (>= 3.5)\n-\t[NumPy](https://numpy.org/) (>= 1.22.0)\n-\t[SciPy](https://scipy.org/) (>= 1.8.0)\n\nif you want to use the visualization module/ functions of spafe, you will need to install:\n\n- [Matplotlib](https://matplotlib.org/) (>= 3.5.2)\n\n\n### Installation guide\nOnce you have the Dependencies installed, use one of the following install options.\n\n#### Install from PyPI\n- To freshly install spafe:\n```\npip install spafe\n```\n-  To update an existing installation:\n```\npip install -U spafe\n```\n\n#### Install from Anaconda\n- Spafe is also available on anaconda:\n```\nconda install spafe\n```\n\n### Install from source\n- You can build spafe from source, by following:\n```\ngit clone git@github.com:SuperKogito/spafe.git\ncd spafe\npython setup.py install\n```\n\n## Why use Spafe?\n\nUnlike most existing audio feature extraction libraries ([python_speech_features](https://github.com/jameslyons/python_speech_features), [SpeechPy](https://github.com/astorfi/speechpy), [surfboard](https://github.com/novoic/surfboard) and [Bob](https://gitlab.idiap.ch/bob)), Spafe provides more options for spectral features extraction algorithms, notably:\n- Bark Frequency Cepstral Coef\ufb01cients (BFCCs)\n- Constant Q-transform Cepstral Coe\ufb03cients (CQCCs)\n- Gammatone Frequency Cepstral Coef\ufb01cients (GFCCs)\n- Power-Normalized Cepstral Coefficients (PNCCs)\n- Phase based Spectral Root Cepstral Coefficients (PSRCCs) \n\nMost 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](https://github.com/librosa/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.\n\n\n## How to use\n\nVarious examples on how to use spafe are present in the documentation [https://superkogito.github.io/spafe](https://superkogito.github.io/spafe).\n\n**<!>** Please make sure you are referring to the correct documentation version.\n\n## Contributing\n\nContributions are welcome and encouraged. To learn more about how to contribute to spafe please refer to the [Contributing guidelines](https://github.com/SuperKogito/spafe/blob/master/CONTRIBUTING.md)\n\n## Citing\n\n-  If you want to cite spafe as a software used in your work, please\n   cite the version used as indexed at [Zenodo](https://zenodo.org/):\n   [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6824667.svg)](https://doi.org/10.5281/zenodo.6824667)\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Simplified Python Audio-Features Extraction.",
    "version": "0.3.1",
    "split_keywords": [
        "audio processing",
        "features extraction"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09a470fdb7c8b50cda49b0c0f73c61634a25ed971efc590af328d413a6f23b46",
                "md5": "f77dda2c71f78c718965de36aaf6060b",
                "sha256": "eaf21520134038f616de4778c8755ff8c2a104635397aebe4c8d935df6f91f08"
            },
            "downloads": -1,
            "filename": "spafe-0.3.1-py3.8.egg",
            "has_sig": false,
            "md5_digest": "f77dda2c71f78c718965de36aaf6060b",
            "packagetype": "bdist_egg",
            "python_version": "0.3.1",
            "requires_python": null,
            "size": 201431,
            "upload_time": "2023-01-13T02:00:17",
            "upload_time_iso_8601": "2023-01-13T02:00:17.948959Z",
            "url": "https://files.pythonhosted.org/packages/09/a4/70fdb7c8b50cda49b0c0f73c61634a25ed971efc590af328d413a6f23b46/spafe-0.3.1-py3.8.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "97cf0bc358d014c5c0ffb7b045d48cb8e0383b0a22382cd6bd86da0cbb84b1d3",
                "md5": "379730e00fabd43b4a4588fc17788e46",
                "sha256": "6e6ab2374022ea8bab637595fc85dbcd044a770ffff2ad4366f9b1acf4566daf"
            },
            "downloads": -1,
            "filename": "spafe-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "379730e00fabd43b4a4588fc17788e46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 93369,
            "upload_time": "2023-01-13T02:00:14",
            "upload_time_iso_8601": "2023-01-13T02:00:14.663053Z",
            "url": "https://files.pythonhosted.org/packages/97/cf/0bc358d014c5c0ffb7b045d48cb8e0383b0a22382cd6bd86da0cbb84b1d3/spafe-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4d557e0cef4a1716180451420a06e5393f2c7113b9f1d5dbad7d0551cec3986",
                "md5": "ea913684d151968445200118439753b8",
                "sha256": "dc8281af23bd192f5f3681fae2dbf4818ee668752076d10adced05f30a8e56be"
            },
            "downloads": -1,
            "filename": "spafe-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ea913684d151968445200118439753b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 50080,
            "upload_time": "2023-01-13T02:00:20",
            "upload_time_iso_8601": "2023-01-13T02:00:20.114525Z",
            "url": "https://files.pythonhosted.org/packages/a4/d5/57e0cef4a1716180451420a06e5393f2c7113b9f1d5dbad7d0551cec3986/spafe-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-13 02:00:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "SuperKogito",
    "github_project": "spafe",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "spafe"
}
        
Elapsed time: 0.02897s