Changeset ca1abdd for tests/python


Ignore:
Timestamp:
Oct 19, 2009, 10:51:59 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:
b14107f
Parents:
9f07d52
Message:

rename aubio_pitchdetection to aubio_pitch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/python/src/pitch/pitchdetection.py

    r9f07d52 rca1abdd  
    77samplerate = 44100.
    88
    9 class pitchdetection_test_case(unittest.TestCase):
     9class pitch_test_case(unittest.TestCase):
    1010
    1111  def setUp(self, type = aubio_pitch_yinfft, mode = aubio_pitchm_freq):
     
    1515      mode = aubio_pitchm_freq):
    1616    self.type = type
    17     self.o = new_aubio_pitchdetection(buf_size, hop_size,
     17    self.o = new_aubio_pitch(buf_size, hop_size,
    1818        channels, int(samplerate), type, mode)
    1919
    2020  def tearDown(self):
    21     del_aubio_pitchdetection(self.o)
     21    del_aubio_pitch(self.o)
    2222
    23   def test_pitchdetection(self):
    24     """ create and delete pitchdetection """
     23  def test_pitch(self):
     24    """ create and delete pitch """
    2525    pass
    2626
    27   def test_pitchdetection_run_zeroes(self):
    28     """ run pitchdetection on an empty buffer """
     27  def test_pitch_run_zeroes(self):
     28    """ run pitch on an empty buffer """
    2929    vec = new_fvec(buf_size, channels)
    3030    out = new_fvec(1, channels)
    3131    for i in range(100):
    32       aubio_pitchdetection_do(self.o,vec, out)
     32      aubio_pitch_do(self.o,vec, out)
    3333      self.assertEqual(fvec_read_sample(out, 0, 0),0.)
    3434    del vec
    3535
    36   def test_pitchdetection_run_4_impulses(self):
    37     """ run pitchdetection on a train of 4 impulses """
     36  def test_pitch_run_4_impulses(self):
     37    """ run pitch on a train of 4 impulses """
    3838    vec = new_fvec(buf_size, channels)
    3939    out = new_fvec(1, channels)
     
    4444    frequency = samplerate/2*4/buf_size
    4545    for i in range(100):
    46       aubio_pitchdetection_do(self.o,vec, out)
     46      aubio_pitch_do(self.o,vec, out)
    4747      self.assertEqual(fvec_read_sample(out, 0, 0),frequency)
    4848    del vec
    4949
    50   def test_pitchdetection_run_4_positive_impulses(self):
    51     """ run pitchdetection on a train of 4 positive impulses of arbitrary size """
     50  def test_pitch_run_4_positive_impulses(self):
     51    """ run pitch on a train of 4 positive impulses of arbitrary size """
    5252    vec = new_fvec(buf_size, channels)
    5353    out = new_fvec(1, channels)
     
    5858      fvec_write_sample(vec, 2.-.01*i,0,  buf_size/2)
    5959      fvec_write_sample(vec, 2.-.01*i,0,3*buf_size/4)
    60       aubio_pitchdetection_do(self.o,vec, out)
     60      aubio_pitch_do(self.o,vec, out)
    6161      self.assertAlmostEqual(fvec_read_sample(out, 0, 0),frequency,1)
    6262    del vec
    6363
    64   def test_pitchdetection_run_4_negative_impulses(self):
    65     """ run pitchdetection on a train of 4 negative impulses of arbitrary size """
     64  def test_pitch_run_4_negative_impulses(self):
     65    """ run pitch on a train of 4 negative impulses of arbitrary size """
    6666    vec = new_fvec(buf_size, channels)
    6767    out = new_fvec(1, channels)
     
    7272      fvec_write_sample(vec,-.01*i,0,  buf_size/2)
    7373      fvec_write_sample(vec,-.01*i,0,3*buf_size/4)
    74       aubio_pitchdetection_do(self.o,vec, out)
     74      aubio_pitch_do(self.o,vec, out)
    7575      self.assertAlmostEqual(fvec_read_sample(out, 0, 0),frequency,1)
    7676    del vec
    7777
    78   def test_pitchdetection_run_8_impulses(self):
    79     """ run pitchdetection on a train of 8 impulses """
     78  def test_pitch_run_8_impulses(self):
     79    """ run pitch on a train of 8 impulses """
    8080    vec = new_fvec(buf_size, channels)
    8181    out = new_fvec(1, channels)
     
    8989    fvec_write_sample(vec,-1.,0,7*buf_size/8)
    9090    for i in range(100):
    91       aubio_pitchdetection_do(self.o,vec, out)
     91      aubio_pitch_do(self.o,vec, out)
    9292      self.assertAlmostEqual(fvec_read_sample(out, 0, 0),
    9393        samplerate/2/buf_size*8, 1)
     
    9595
    9696"""
    97 class pitchdetection_yin_test_case(pitchdetection_test_case):
     97class pitch_yin_test_case(pitchdetection_test_case):
    9898  def setUp(self, type = aubio_pitch_yin):
    9999    self.create(type=type)
    100100
    101 class pitchdetection_fcomb_test_case(pitchdetection_test_case):
     101class pitch_fcomb_test_case(pitchdetection_test_case):
    102102  def setUp(self, type = aubio_pitch_fcomb):
    103103    self.create(type=type)
    104104
    105 class pitchdetection_mcomb_test_case(pitchdetection_test_case):
     105class pitch_mcomb_test_case(pitchdetection_test_case):
    106106  def setUp(self, type = aubio_pitch_mcomb):
    107107    self.create(type=type)
    108108
    109 class pitchdetection_schmitt_test_case(pitchdetection_test_case):
     109class pitch_schmitt_test_case(pitchdetection_test_case):
    110110  def setUp(self, type = aubio_pitch_schmitt):
    111111    self.create(type=type)
Note: See TracChangeset for help on using the changeset viewer.