CPJKU/madmom

BarkFilterbank is missing from madmom.audio.filters from pip

sevagh opened this issue · 1 comments

I installed madmom 0.16.1 from pip (Python 3.8, Fedora 32):

$ pip list | grep madmom
madmom                 0.16.1

It doesn't have any bark code in audio/filters.py:

sevagh:tRNNsient $ grep -i 'bark' ~/.local/lib/python3.8/site-packages/madmom/a
udio/filters.py
sevagh:tRNNsient $
sevagh:tRNNsient $ grep -i 'mel' ~/.local/lib/python3.8/site-packages/madmom/au
dio/filters.py
# Mel frequency scale
def hz2mel(f):
    Convert Hz frequencies to Mel.
        Frequencies in Mel [Mel].
def mel2hz(m):
    Convert Mel frequencies to Hz.
        Input frequencies [Mel].
def mel_frequencies(num_bands, fmin, fmax):
    Returns frequencies aligned on the Mel scale.
    mel_frequencies: numpy array
        Frequencies with Mel spacing [Hz].
    # convert fmin and fmax to the Mel scale and return an array of frequencies
    return mel2hz(np.linspace(hz2mel(fmin), hz2mel(fmax), num_bands))
class MelFilterbank(Filterbank):
    Mel filterbank class.
        # get a list of frequencies aligned on the Mel scale
        frequencies = mel_frequencies(num_bands + 2, fmin, fmax)
        # create a MelFilterbank from the filters

This code is not thoroughly tested and thus not included in the pip packages. If you need this code, please install from source.