biosppy.features.cepstral

biosppy.features.cepstral

This module provides methods to extract cepstral features.

copyright:
  1. 2015-2026 by Instituto de Telecomunicacoes

license:

BSD 3-clause, see LICENSE for more details.

Functions

cepstral([signal, sampling_rate])

Compute quefrency metrics describing the signal.

freq_to_mel(hertz)

Converts mel-frequencies to hertz frequencies [Kool12].

mel_to_freq(mel)

Converts mel-frequencies to hertz frequencies.

mfcc([signal, sampling_rate, window_size, ...])

Computes the mel-frequency cepstral coefficients.

biosppy.features.cepstral.cepstral(signal=None, sampling_rate=1000.0)[source]

Compute quefrency metrics describing the signal.

Parameters:
  • signal (array) – Input signal.

  • sampling_rate (int, float, optional) – Sampling frequency (Hz).

Returns:

feats (ReturnTuple object) – Time features computed over the signal mel-frequency cepstral coefficients.

Notes

Check biosppy.features.time for the list of time features.

biosppy.features.cepstral.freq_to_mel(hertz)[source]

Converts mel-frequencies to hertz frequencies [Kool12].

Parameters:

hertz (array) – Hertz frequencies.

Returns:

mel frequencies (array) – Mel frequencies.

References

[Kool12]

Shashidhar G. Koolagudi, Deepika Rastogi, K. Sreenivasa Rao, Identification of Language using

Mel-Frequency Cepstral Coefficients (MFCC), Procedia Engineering, Volume 38, 2012, Pages 3391-3398, ISSN 1877-7058

biosppy.features.cepstral.mel_to_freq(mel)[source]

Converts mel-frequencies to hertz frequencies.

Parameters:

mel (array) – Mel frequencies.

Returns:

hertz frequencies (array) – Hertz frequencies.

References

[Kool12]

Shashidhar G. Koolagudi, Deepika Rastogi, K. Sreenivasa Rao, Identification of Language using

Mel-Frequency Cepstral Coefficients (MFCC), Procedia Engineering, Volume 38, 2012, Pages 3391-3398, ISSN 1877-7058

biosppy.features.cepstral.mfcc(signal=None, sampling_rate=1000.0, window_size=100, num_filters=10)[source]

Computes the mel-frequency cepstral coefficients.

Parameters:
  • signal (array) – Input signal.

  • sampling_rate (int, float, optional) – Sampling frequency (Hz).

  • window_size (int) – DFT window size.

  • num_filters (int) – Number of filters.

Returns:

mfcc (array) – Signal mel-frequency cepstral coefficients.

References

[Haytham16]

Fayek, Haytham. “Speech Processing for Machine Learning: Filter banks, Mel-Frequency Cepstral Coefficients (MFCCs) and What’s In-Between.”Blog post. 2016. https://haythamfayek.com/2016/04/21/speech-processing-for-machine-learning.html

[Brihijoshi]

‘Vanilla STFT and MFCC’ by brihijoshi, accessed in october 2022:https://github.com/brihijoshi/vanilla-stft-mfcc/

[Tsfel]

‘Time Series Feature Extraction Library’ by fraunhoferportugal, accessed in october 2022: https://github.com/fraunhoferportugal/tsfel/

[Ilyamich]

‘MFCC implementation and tutorial’ by ilyamich, accessed in october 2022: https://www.kaggle.com/code/ilyamich/mfcc-implementation-and-tutorial