mirror of
https://github.com/google/liblc3.git
synced 2026-04-28 09:44:50 +00:00
test: Various fixes on python simulation code
This commit is contained in:
18
test/ltpf.py
18
test/ltpf.py
@@ -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)) \
|
||||
|
||||
Reference in New Issue
Block a user