Changeset 5a93302


Ignore:
Timestamp:
Oct 8, 2009, 2:35:50 AM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

tests/python/src/onset/peakpick.py: update to interpolated peak position

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/python/src/onset/peakpick.py

    r2672d67 r5a93302  
    2121  def test_peakpick_zeroes(self):
    2222    """ 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))
    2424
    2525  def test_peakpick_impulse(self):
     
    3131      fvec_write_sample(input, 1000., 0, index)
    3232      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), "|",
    3434      #for i in range(buf_size): print fvec_read_sample(input, 0, i),
    3535      #print
     
    4545      fvec_write_sample(input, 1000., 0, index+3)
    4646      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 )
    4953      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       #print
    5354      del_fvec(input)
    5455    for index in range(buf_size-4,buf_size-1):
     
    5657      fvec_write_sample(input, 1000./2, 0, index)
    5758      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)
    6161      del_fvec(input)
    6262
Note: See TracChangeset for help on using the changeset viewer.