mfcc¶
This module contains the following classes:
MFCC
, computing Mel-frequency cepstral coefficients (MFCCs).
This file is a modified version of the mfcc.py
file
by David Huggins-Daines from the CMU Sphinx-III project.
You can find the original file in the thirdparty/
directory.
-
class
aeneas.mfcc.
MFCC
(rconf=None, logger=None)[source]¶ A class for computing Mel-frequency cepstral coefficients (MFCCs).
Parameters: - rconf (
RuntimeConfiguration
) – a runtime configuration - logger (
Logger
) – the logger object
-
CUTOFF
= 1e-05¶ Cut-off threshold
-
MEL_10
= 2595.0¶ Base Mel frequency
-
compute_from_data
(data, sample_rate)[source]¶ Compute MFCCs for the given audio data.
The audio data must be a 1D
numpy.ndarray
, that is, it must represent a monoaural (single channel) array offloat64
values in[-1.0, 1.0]
.Parameters: - data (
numpy.ndarray
(1D)) – the audio data - sample_rate (int) – the sample rate of the audio data, in samples/s (Hz)
Raises: ValueError: if the data is not a 1D
numpy.ndarray
(i.e., not mono), or if the data is emptyRaises: ValueError: if the upper frequency defined in the
rconf
is larger than the Nyquist frequenct (i.e., half ofsample_rate
)- data (
- rconf (