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)
def test_mcep2coef(self): mcep = spec2mcep(self.pspec, 20, self.alpha) coef = mcep2coef(mcep, self.alpha) mcep2 = coef2mcep(coef, self.alpha) sqerr = np.sqrt((mcep - mcep2)**2).sum() assert sqerr < 0.0001, sqerr
def test_mcep2coef(self): mcep = spec2mcep(self.pspec, 20, self.alpha) coef = mcep2coef(mcep, self.alpha) mcep2 = coef2mcep(coef, self.alpha) sqerr = np.sqrt((mcep - mcep2) ** 2).sum() assert sqerr < 0.0001, sqerr