Changeset dfada33 for python/tests
- Timestamp:
- May 2, 2016, 12:02:06 PM (9 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:
- 8147e03
- Parents:
- ad5eae8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_phasevoc.py
rad5eae8 rdfada33 3 3 from numpy.testing import TestCase, assert_equal, assert_array_less 4 4 from aubio import fvec, cvec, pvoc, float_type 5 from numpy import array, shape6 from numpy.random import random7 5 from nose2.tools import params 8 6 import numpy as np … … 50 48 assert_equal ( s.phas, 0.) 51 49 assert_equal ( r, 0.) 52 53 def test_resynth_8_steps_sine(self):54 """ check the resynthesis of is correct with 87.5% overlap """55 hop_s = 102456 ratio = 857 freq = 445; samplerate = 2205058 sigin = create_sine(hop_s, freq, samplerate)59 self.reconstruction( sigin, hop_s, ratio)60 61 def test_resynth_8_steps(self):62 """ check the resynthesis of is correct with 87.5% overlap """63 hop_s = 102464 ratio = 865 sigin = create_noise(hop_s)66 self.reconstruction(sigin, hop_s, ratio)67 68 def test_resynth_4_steps_sine(self):69 """ check the resynthesis of is correct with 87.5% overlap """70 hop_s = 102471 ratio = 472 freq = 445; samplerate = 2205073 sigin = create_sine(hop_s, freq, samplerate)74 self.reconstruction(sigin, hop_s, ratio)75 76 def test_resynth_4_steps(self):77 """ check the resynthesis of is correct with 75% overlap """78 hop_s = 102479 ratio = 480 sigin = create_noise(hop_s)81 self.reconstruction(sigin, hop_s, ratio)82 83 def test_resynth_2_steps_sine(self):84 """ check the resynthesis of is correct with 50% overlap """85 hop_s = 102486 ratio = 287 freq = 445; samplerate = 2205088 sigin = create_sine(hop_s, freq, samplerate)89 self.reconstruction(sigin, hop_s, ratio)90 91 def test_resynth_2_steps(self):92 """ check the resynthesis of is correct with 50% overlap """93 hop_s = 102494 ratio = 295 sigin = create_noise(hop_s)96 self.reconstruction(sigin, hop_s, ratio)97 50 98 51 @params( … … 154 107 assert_array_less(sq_error, max_sq_error) 155 108 109 def test_large_input_timegrain(self): 110 win_s = 1024 111 f = pvoc(win_s) 112 t = fvec(win_s + 1) 113 with self.assertRaises(ValueError): 114 f(t) 115 116 def test_small_input_timegrain(self): 117 win_s = 1024 118 f = pvoc(win_s) 119 t = fvec(1) 120 with self.assertRaises(ValueError): 121 f(t) 122 123 def test_large_input_fftgrain(self): 124 win_s = 1024 125 f = pvoc(win_s) 126 s = cvec(win_s + 5) 127 with self.assertRaises(ValueError): 128 f.rdo(s) 129 130 def test_small_input_fftgrain(self): 131 win_s = 1024 132 f = pvoc(win_s) 133 s = cvec(16) 134 with self.assertRaises(ValueError): 135 f.rdo(s) 136 156 137 if __name__ == '__main__': 157 138 from nose2 import main
Note: See TracChangeset
for help on using the changeset viewer.