1 from numpy.testing import TestCase, run_module_suite
2 from numpy.testing import assert_equal, assert_almost_equal
3 from numpy import array, shape
6 class aubio_filter_test_case(TestCase):
9 f = filterbank(40, 512)
10 f.set_mel_coeffs_slaney(16000)
14 def test_other_slaney(self):
15 f = filterbank(40, 512*2)
16 f.set_mel_coeffs_slaney(44100)
18 #print "sum is", sum(sum(a))
19 for win_s in [256, 512, 1024, 2048, 4096]:
20 f = filterbank(40, win_s)
21 f.set_mel_coeffs_slaney(320000)
23 #print "sum is", sum(sum(a))
25 def test_triangle_freqs(self):
26 f = filterbank(9, 1024)
27 freq_list = [40, 80, 200, 400, 800, 1600, 3200, 6400, 12800, 15000, 24000]
28 freqs = array(freq_list, dtype = 'float32')
29 f.set_triangle_bands(freqs, 48000)
31 assert_equal ( f(cvec(1024)), [0] * 9)
36 if __name__ == '__main__':
37 from unittest import main