class SynthesisTest(TestCase): def setUp(self): signal, samplingrate, _ = waveread("test/cmu_arctic/arctic_a0001.wav") self.world = World(samplingrate) self.alpha = estimate_alpha(samplingrate) self.samplingrate = samplingrate self.signal = signal self.f0, self.spec_mat, _ = self.world.analyze(signal) self.ep = ExcitePulse(16000, 80, False) self.order = 24 def test_synthesis_filter(self): excite = self.ep.gen(self.f0) mcep_mat = spec2mcep_from_matrix(self.spec_mat, self.order, self.alpha) coef_mat = [] for i in range(mcep_mat.shape[0]): coef_mat.append(mcep2coef(mcep_mat[i], 0.41)) coef_mat = np.array(coef_mat) mlsa = MLSAFilter(self.order, self.alpha, 5) syn = Synthesis(80, mlsa) synth = syn.synthesis(excite, coef_mat)