Esempio n. 1
0
 def test_a_weighting(self):
     expected = array_from_text_file('a_weighting_test_simple.expected')
     f = digital_filter(7)
     f.set_a_weighting(44100)
     v = fvec(32)
     v[12] = .5
     u = f(v)
     assert_almost_equal (expected[1], u)
Esempio n. 2
0
 def test_c_weighting_8000(self):
     expected = array_from_text_file('c_weighting_test_simple_8000.expected')
     f = digital_filter(5)
     f.set_c_weighting(8000)
     v = fvec(32)
     v[12] = .5
     u = f(v)
     assert_almost_equal (expected[1], u)
Esempio n. 3
0
 def test_a_weighting_parted(self):
     expected = array_from_text_file('a_weighting_test_simple.expected')
     f = digital_filter(7)
     f.set_a_weighting(44100)
     v = fvec(16)
     v[12] = .5
     u = f(v)
     assert_almost_equal (expected[1][:16], u)
     # one more time
     v = fvec(16)
     u = f(v)
     assert_almost_equal (expected[1][16:], u)
 def test_mfcc_coeffs_16000(self):
   expected = array_from_text_file('filterbank_mfcc_16000_512.expected')
   f = filterbank(40, 512)
   f.set_mel_coeffs_slaney(16000)
   assert_almost_equal ( expected, f.get_coeffs() )
Esempio n. 5
0
 def test_mfcc_coeffs_16000(self):
     expected = array_from_text_file('filterbank_mfcc_16000_512.expected')
     f = filterbank(40, 512)
     f.set_mel_coeffs_slaney(16000)
     assert_almost_equal(expected, f.get_coeffs())