Changeset 5a93302 for tests/python/src/onset/peakpick.py
- Timestamp:
- Oct 8, 2009, 2:35:50 AM (15 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- c9ca5a6e
- Parents:
- 2672d67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/python/src/onset/peakpick.py
r2672d67 r5a93302 21 21 def test_peakpick_zeroes(self): 22 22 """ check peakpick run on a vector full of zero returns no peak. """ 23 self.assertEqual(0., aubio_peakpick _pimrt_getval(self.o))23 self.assertEqual(0., aubio_peakpicker_get_thresholded_input(self.o)) 24 24 25 25 def test_peakpick_impulse(self): … … 31 31 fvec_write_sample(input, 1000., 0, index) 32 32 fvec_write_sample(input, 1000./2, 0, index+1) 33 #print "%2s" % index, aubio_peakpick _pimrt(input, self.o), "|",33 #print "%2s" % index, aubio_peakpicker_do(self.o, input), "|", 34 34 #for i in range(buf_size): print fvec_read_sample(input, 0, i), 35 35 #print … … 45 45 fvec_write_sample(input, 1000., 0, index+3) 46 46 fvec_write_sample(input, 1000./2, 0, index+4) 47 peak_pick_result = aubio_peakpick_pimrt(input, self.o) 48 if index == 2: self.assertEqual(1., peak_pick_result) 47 peak_pick_result = aubio_peakpicker_do(self.o, input) 48 if index == 2: 49 # we are at the peak. check the result is after current sample, 50 # and not after next one 51 self.failIf( 1. >= peak_pick_result ) 52 self.failIf( 2. < peak_pick_result ) 49 53 else: self.assertEqual(0., peak_pick_result) 50 #print "%2s" % index, peak_pick_result, "|",51 #for i in range(buf_size): print fvec_read_sample(input, 0, i),52 #print53 54 del_fvec(input) 54 55 for index in range(buf_size-4,buf_size-1): … … 56 57 fvec_write_sample(input, 1000./2, 0, index) 57 58 fvec_write_sample(input, 1000., 0, index+1) 58 #print "%2s" % index, aubio_peakpick_pimrt(input, self.o), "|", 59 #for i in range(buf_size): print fvec_read_sample(input, 0, i), 60 #print 59 peak_pick_result = aubio_peakpicker_do(self.o, input) 60 self.assertEqual(0., peak_pick_result) 61 61 del_fvec(input) 62 62
Note: See TracChangeset
for help on using the changeset viewer.