Bugfix for overall channel in SLM, code improvement in octave filter.

This commit is contained in:
Anne de Jong 2020-02-09 15:08:48 +01:00
parent d67fce8d06
commit 748358a453
2 changed files with 6 additions and 9 deletions

View File

@ -228,6 +228,11 @@ class SosFilterBank:
xmin: Minimum value for the bands
xmax: Maximum value for the bands
"""
if xmin is None:
xmin = self.designer.xs[0]
if xmax is None:
xmax = self.designer.xs[-1]
self.fs = fs
self.xs = list(range(xmin, xmax + 1))
nfilt = len(self.xs)
@ -290,10 +295,6 @@ class SosThirdOctaveFilterBank(SosFilterBank):
xmax: Maximum value for the bands
"""
self.designer = ThirdOctaveBankDesigner(fs)
if xmin is None:
xmin = self.designer.xs[0]
if xmax is None:
xmax = self.designer.xs[-1]
SosFilterBank.__init__(self, fs, xmin, xmax)
@ -313,10 +314,6 @@ class SosOctaveFilterBank(SosFilterBank):
xmax: Maximum value for the bands, if not specified, use maximum
"""
self.designer = OctaveBankDesigner(fs)
if xmin is None:
xmin = self.designer.xs[0]
if xmax is None:
xmax = self.designer.xs[-1]
SosFilterBank.__init__(self, fs, xmin, xmax)

View File

@ -149,7 +149,7 @@ class SLM:
'data': levels[:, [i]],
'x': x}
if self.include_overall and self.fbdesigner is not None:
output['overall'] = {'t': t, 'data': levels[:, i+1], 'x': 0}
output['overall'] = {'t': t, 'data': levels[:, [i+1]], 'x': 0}
return output