test: Various fixes on python simulation code

This commit is contained in:
Antoine SOULIER
2022-07-25 14:14:08 +02:00
parent c3071e0a29
commit b5e7751068
4 changed files with 20 additions and 14 deletions

View File

@@ -68,7 +68,7 @@ class Tns:
self.dt = dt
(self.nfilters, self.lpc_weighting, self.rc_order, self.rc) = \
(None, None, None, None)
(None, None, [ None, None ], [ None, None ])
def get_data(self):
@@ -133,7 +133,7 @@ class TnsAnalysis(Tns):
return (r[0] / err, a)
def lpc_weighting(self, pred_gain, a):
def lpc_weight(self, pred_gain, a):
gamma = 1 - (1 - 0.85) * (2 - pred_gain) / (2 - 1.5)
return a * np.power(gamma, np.arange(len(a)))
@@ -199,7 +199,7 @@ class TnsAnalysis(Tns):
continue
if self.lpc_weighting and pred_gain < 2:
a = self.lpc_weighting(pred_gain, a)
a = self.lpc_weight(pred_gain, a)
rc = self.coeffs_reflexion(a)