def test_melfb():

    def __test(infile):
        DATA = load(infile)

        wts = librosa.filters.mel(DATA['sr'][0],
                                  DATA['nfft'][0],
                                  n_mels=DATA['nfilts'][0],
                                  fmin=DATA['fmin'][0],
                                  fmax=DATA['fmax'][0],
                                  htk=DATA['htk'][0])

        # Our version only returns the real-valued part.
        # Pad out.
        wts = np.pad(wts, [(0, 0),
                              (0, int(1 - DATA['nfft'][0]//2))],
                        mode='constant')

        eq_(wts.shape, DATA['wts'].shape)
        assert np.allclose(wts, DATA['wts'])

    for infile in files('data/feature-melfb-*.mat'):
        yield (__test, infile)
dataset/ETHPy150Open bmcfee/librosa/tests/test_filters.py/test_melfb/swapped operands of `-`