CPJKU / madmom

Python audio and music signal processing library
https://madmom.readthedocs.io
Other
1.31k stars 199 forks source link

MFCC expects spectrogram to have attribute `filterbank` #380

Open nielsrolf opened 6 years ago

nielsrolf commented 6 years ago

I try to create a MFCC from a spectrogram.

Expected behaviour

It works without error.

Actual behaviour

It gives this error:

--> 345     mfcc = MFCC(spectrogram, filterbank=madmom.audio.filters.MelFilterbank)

.../music/madmom/madmom/audio/cepstrogram.py in __new__(cls, spectrogram, transform, filterbank, num_bands, fmin, fmax, norm_filters, mul, add, **kwargs)
    196 
    197         # recalculate the spec if it is filtered or scaled already
--> 198         if (spectrogram.filterbank is not None or
    199                 spectrogram.mul is not None or
    200                 spectrogram.add is not None):

AttributeError: 'Spectrogram' object has no attribute 'filterbank'

Steps needed to reproduce the behaviour

import madmom
from madmom.audio.cepstrogram import MFCC
spectrogram = madmom.audio.spectrogram.Spectrogram(audio_path, frame_size=2048, hop_size=200, fft_size=4096)
mfcc = MFCC(spectrogram)

Information about installed software

import madmom
import numpy as np
import scipy

>>> madmom.__version__
'0.16.dev0'
>>> np.__version__
'1.14.0'
>>> scipy.__version__
'1.0.0'
superbock commented 6 years ago

There's a new MFCC implementation available (https://github.com/CPJKU/madmom/pull/269). Unfortunately I did not have time to review and merge it. Could you try if this branch works for you?

jomonson commented 5 years ago

I have the latest release of madmom but I can't load cepstrogram module from madmom.audio. Am I missing some dependency or having a wrong configuration in the environment?

superbock commented 5 years ago

It is not available in any release yet, because it is not merged into the master branch yet. So you have to check out the mfccs branch. Please be aware that minor implementation details might change when it is merged into master.