Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -47,6 +47,15 @@ class aubio_filterbank_mel_test_case(TestCase): · 46 unmodified lines | ||
| 47 | 47 | [ 0.02070313, 0.02138672, 0.02127604, 0.02135417, |
| 48 | 48 | 0.02133301, 0.02133301, 0.02133311, 0.02133334, 0.02133345]) |
| 49 | 49 | |
| 50 | + def test_triangle_freqs_with_zeros(self): | |
| 51 | + """make sure set_triangle_bands works when list starts with 0""" | |
| 52 | + freq_list = [0, 40, 80] | |
| 53 | + freqs = np.array(freq_list, dtype = float_type) | |
| 54 | + f = filterbank(len(freqs)-2, 1024) | |
| 55 | + f.set_triangle_bands(freqs, 48000) | |
| 56 | + assert_equal ( f(cvec(1024)), 0) | |
| 57 | + self.assertIsInstance(f.get_coeffs(), np.ndarray) | |
| 58 | + | |
| 50 | 59 | if __name__ == '__main__': |
| 51 | 60 | import nose2 |
| 52 | 61 | nose2.main() |