merge from develop
[aubio.git] / python / tests / test_filterbank.py
1 #! /usr/bin/env python
2
3 from numpy.testing import TestCase, run_module_suite
4 from numpy.testing import assert_equal, assert_almost_equal
5 from numpy import random
6 from aubio import cvec, filterbank
7
8 class aubio_filterbank_test_case(TestCase):
9
10   def test_members(self):
11     f = filterbank(40, 512)
12     assert_equal ([f.n_filters, f.win_s], [40, 512])
13
14   def test_set_coeffs(self):
15     f = filterbank(40, 512)
16     r = random.random([40, 512 / 2 + 1]).astype('float32')
17     f.set_coeffs(r)
18     assert_equal (r, f.get_coeffs())
19
20 if __name__ == '__main__':
21   from unittest import main
22   main()
23