Created
October 15, 2019 00:00
-
-
Save dmastropole/cc155a4351cf9d672134b78f02602810 to your computer and use it in GitHub Desktop.
Compute MFCCs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from essentia.standard import MFCC, FrameGenerator | |
mfcc = MFCC(highFrequencyBound=f_high, | |
lowFrequencyBound=f_low, | |
inputSize=1024, | |
numberBands=n_bands, | |
numberCoefficients=13, | |
type='magnitude', | |
sampleRate=44100) | |
# Compute MFCCs for all frames | |
mfccs = [] | |
for frame in FrameGenerator(audio, | |
frameSize=1024, | |
hopSize=512, | |
startFromZero=True): | |
_, coeffs = mfcc(spectrum(w(frame))) | |
mfccs.append(coeffs) | |
# Take the transpose so frames can be plotted on the x-axis | |
mfccs = essentia.array(mfccs).T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment