Changeset b74513d for python/tests
- Timestamp:
- Jan 29, 2015, 3:53:08 PM (10 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:
- 16f8dcc
- Parents:
- 048dd6c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_pitch.py
r048dd6c rb74513d 68 68 errors = errors[2:] 69 69 # check that the mean of all relative errors is less than 10% 70 assert abs (mean(errors) ) < 0.1, pitches71 assert abs (me an(errors) ) < 0.1, "error is bigger than 0.1 (%f)" % mean(errors)70 #assert abs (mean(errors) ) < 0.1, pitches 71 assert abs (median(errors) ) < 0.06, "median of relative errors is bigger than 0.06 (%f)\n found %s\n errors %s" % (mean(errors), pitches, errors) 72 72 #print 'len(pitches), cut:', len(pitches), cut 73 #print 'me an errors: ', mean(errors), 'mean pitches: ', mean(pitches)73 #print 'median errors: ', median(errors), 'median pitches: ', median(pitches) 74 74 75 75 pitch_algorithms = [ "default", "yinfft", "yin", "schmitt", "mcomb", "fcomb" , "specacf" ] 76 pitch_algorithms = [ "default", "yinfft", "yin", "schmitt", "mcomb", "fcomb" ] 76 77 78 #freqs = [ 27.5, 55., 110., 220., 440., 880., 1760., 3520. ] 79 freqs = [ 110., 220., 440., 880., 1760., 3520. ] 80 signal_modes = [] 81 for freq in freqs: 82 signal_modes += [ 83 ( 4096, 2048, 44100, freq ), 84 ( 2048, 512, 44100, freq ), 85 ( 2048, 1024, 44100, freq ), 86 ( 2048, 1024, 32000, freq ), 87 ] 88 89 freqs = [ ] #55., 110., 220., 440., 880., 1760., 3520. ] 90 for freq in freqs: 91 signal_modes += [ 92 ( 2048, 1024, 22050, freq ), 93 ( 1024, 256, 16000, freq ), 94 ( 1024, 256, 8000, freq ), 95 ( 1024, 512+256, 8000, freq ), 96 ] 97 98 """ 77 99 signal_modes = [ 78 100 ( 4096, 512, 44100, 2.*882. ), … … 88 110 ( 1024, 512+256, 8000, 440. ), 89 111 ] 112 """ 90 113 91 114 def create_test (algo, mode): … … 97 120 for mode in signal_modes: 98 121 test_method = create_test (algo, mode) 99 test_method.__name__ = 'test_pitch_%s_%d_%d_%dHz_sin_%. 2f' % ( algo,122 test_method.__name__ = 'test_pitch_%s_%d_%d_%dHz_sin_%.0f' % ( algo, 100 123 mode[0], mode[1], mode[2], mode[3] ) 101 124 setattr (aubio_pitch_Sinusoid, test_method.__name__, test_method)
Note: See TracChangeset
for help on using the changeset viewer.