From 98c712ebf731a23b5252162007289809c637f431 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 9 Nov 2018 17:30:38 +0100 Subject: [PATCH] [tests] set_triangle_bands should when list starts with 0 (see #206) --- python/tests/test_filterbank_mel.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/tests/test_filterbank_mel.py b/python/tests/test_filterbank_mel.py index a45dbf07..a42fe3d1 100755 --- a/python/tests/test_filterbank_mel.py +++ b/python/tests/test_filterbank_mel.py @@ -47,6 +47,15 @@ class aubio_filterbank_mel_test_case(TestCase): [ 0.02070313, 0.02138672, 0.02127604, 0.02135417, 0.02133301, 0.02133301, 0.02133311, 0.02133334, 0.02133345]) + def test_triangle_freqs_with_zeros(self): + """make sure set_triangle_bands works when list starts with 0""" + freq_list = [0, 40, 80] + freqs = np.array(freq_list, dtype = float_type) + f = filterbank(len(freqs)-2, 1024) + f.set_triangle_bands(freqs, 48000) + assert_equal ( f(cvec(1024)), 0) + self.assertIsInstance(f.get_coeffs(), np.ndarray) + if __name__ == '__main__': import nose2 nose2.main() -- 2.11.0