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

@@ -133,15 +133,6 @@ class Ltpf:
(self.pitch_present, self.pitch_index) = (None, None)
def get_data(self):
return { 'active' : self.active,
'pitch_index' : self.pitch_index }
def get_nbits(self):
return 1 + 10 * int(self.pitch_present)
class LtpfAnalysis(Ltpf):
@@ -160,6 +151,15 @@ class LtpfAnalysis(Ltpf):
self.pitch = 0
self.nc = np.zeros(2)
def get_data(self):
return { 'active' : self.active,
'pitch_index' : self.pitch_index }
def get_nbits(self):
return 1 + 10 * int(self.pitch_present)
def correlate(self, x, n, k0, k1):
return [ np.dot(x[:n], np.take(x, np.arange(n) - k)) \