コード例 #1
0
ファイル: test_musicutils.py プロジェクト: drogenlied/aubio
 def test_fail_size_not_int(self):
     try:
         window("default", "default")
     except ValueError as e:
         pass
     else:
         self.fail('non-integer window length does not raise a ValueError')
コード例 #2
0
ファイル: test_musicutils.py プロジェクト: drogenlied/aubio
 def test_fail_name_not_string(self):
     try:
         window(10, 1024)
     except ValueError as e:
         pass
     else:
         self.fail('non-string window type does not raise a ValueError')
コード例 #3
0
 def test_fail_size_not_int(self):
     try:
         window("default", "default")
     except ValueError as e:
         pass
     else:
         self.fail('non-integer window length does not raise a ValueError')
コード例 #4
0
 def test_fail_name_not_string(self):
     try:
         window(10, 1024)
     except ValueError as e:
         pass
     else:
         self.fail('non-string window type does not raise a ValueError')
コード例 #5
0
 def test_compute_hanning_1024(self):
     size = 1024
     aubio_window = window("hanning", size)
     numpy_window = .5 - .5 * cos(2. * pi * arange(size) / size)
     assert_almost_equal(aubio_window, numpy_window)
コード例 #6
0
 def test_fail_size_not_int(self):
     try:
         window("default", "default")
     except ValueError, e:
         pass
コード例 #7
0
 def test_fail_name_not_string(self):
     try:
         window(10, 1024)
     except ValueError, e:
         pass
コード例 #8
0
 def test_accept_name_and_size(self):
     window("default", 1024)
コード例 #9
0
ファイル: test_musicutils.py プロジェクト: aubio/aubio
 def test_fail_size_not_int(self):
     with self.assertRaises(TypeError):
         window("default", "default")
コード例 #10
0
ファイル: test_musicutils.py プロジェクト: aubio/aubio
 def test_fail_name_not_string(self):
     with self.assertRaises(TypeError):
         window(10, 1024)
コード例 #11
0
 def test_compute_hanning_1024(self):
     size = 1024
     aubio_window = window("hanning", size)
     numpy_window = .5 - .5 * np.cos(2. * np.pi * np.arange(size) / size)
     assert_almost_equal(aubio_window, numpy_window)
コード例 #12
0
 def test_fail_size_not_int(self):
     with self.assertRaises(TypeError):
         window("default", "default")
コード例 #13
0
 def test_fail_name_not_string(self):
     with self.assertRaises(TypeError):
         window(10, 1024)
コード例 #14
0
 def test_accept_name_and_size(self):
     window("default", 1024)
コード例 #15
0
ファイル: test_musicutils.py プロジェクト: nphilipp/aubio
 def test_fail_size_not_int(self):
     try:
         window("default", "default")
     except ValueError, e:
         pass
コード例 #16
0
ファイル: test_musicutils.py プロジェクト: nphilipp/aubio
 def test_fail_name_not_string(self):
     try:
         window(10, 1024)
     except ValueError, e:
         pass