Changeset 376d5e9 for python/tests/test_filterbank.py
- Timestamp:
- Apr 18, 2016, 11:46:18 PM (4 years ago)
- Branches:
- feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 81ad577, e76842e
- Parents:
- 6db7600
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_filterbank.py
r6db7600 r376d5e9 17 17 def test_set_coeffs(self): 18 18 f = filterbank(40, 512) 19 r = random.random([40, 512 / 2+ 1]).astype('float32')19 r = random.random([40, int(512 / 2) + 1]).astype('float32') 20 20 f.set_coeffs(r) 21 21 assert_equal (r, f.get_coeffs()) … … 36 36 f = filterbank(40, 512) 37 37 c = cvec(512) 38 c.norm[:] = random.random(( 512 / 2+ 1,)).astype('float32')38 c.norm[:] = random.random((int(512 / 2) + 1,)).astype('float32') 39 39 assert_equal( f(c), 0) 40 40 … … 42 42 f = filterbank(40, 512) 43 43 c = cvec(512) 44 r = random.random([40, 512 / 2+ 1]).astype('float32')44 r = random.random([40, int(512 / 2) + 1]).astype('float32') 45 45 r /= r.sum() 46 46 f.set_coeffs(r) 47 c.norm[:] = random.random(( 512 / 2+ 1,)).astype('float32')47 c.norm[:] = random.random((int(512 / 2) + 1,)).astype('float32') 48 48 assert_equal ( f(c) < 1., True ) 49 49 assert_equal ( f(c) > 0., True ) … … 53 53 c = cvec(512) 54 54 f.set_mel_coeffs_slaney(44100) 55 c.norm[:] = random.random(( 512 / 2+ 1,)).astype('float32')55 c.norm[:] = random.random((int(512 / 2) + 1,)).astype('float32') 56 56 assert_equal ( f(c) < 1., True ) 57 57 assert_equal ( f(c) > 0., True )
Note: See TracChangeset
for help on using the changeset viewer.