source: interfaces/python/test_filterbank.py @ 4722e63

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 4722e63 was 5e3ed60, checked in by Paul Brossier <piem@piem.org>, 12 years ago

test_filterbank.py: splitted and completed

  • Property mode set to 100755
File size: 586 bytes
Line 
1#! /usr/bin/python
2
3from numpy.testing import TestCase, run_module_suite
4from numpy.testing import assert_equal, assert_almost_equal
5from numpy import random
6from aubio import cvec, filterbank
7
8class 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
20if __name__ == '__main__':
21  from unittest import main
22  main()
23
Note: See TracBrowser for help on using the repository browser.