Renamed nominals to nominals_txt

This commit is contained in:
Anne de Jong 2018-09-21 09:16:58 +02:00 committed by J.A. de Jong - ASCEE
parent bbdbb6b707
commit 3c0562cee4
3 changed files with 9 additions and 9 deletions

View File

@ -101,7 +101,7 @@ class OctaveBankDesigner(FilterBankDesigner):
def xs(self):
return list(range(-6, 5))
def nominal(self, x):
def nominal_txt(self, x):
# Text corresponding to the nominal frequency
nominals = {4: '16k',
3: '8k',
@ -164,7 +164,7 @@ class ThirdOctaveBankDesigner(FilterBankDesigner):
def __init__(self):
self.xs = list(range(-16, 14))
# Text corresponding to the nominal frequency
self.nominal_txt = ['25', '31.5', '40',
self._nominal_txt = ['25', '31.5', '40',
'50', '63', '80',
'100', '125', '160',
'200', '250', '315',
@ -175,18 +175,18 @@ class ThirdOctaveBankDesigner(FilterBankDesigner):
'6.3k', '8k', '10k',
'12.5k', '16k', '20k']
assert len(self.xs) == len(self.nominal_txt)
assert len(self.xs) == len(self._nominal_txt)
@property
def b(self):
# Band division factor, 3 for one-third octave bands
return 3
def nominal(self, x):
def nominal_txt(self, x):
# Put the nominal frequencies in a dictionary for easy access with
# x as the key.
index = x - self.xs[0]
return self.nominal_txt[index]
return self._nominal_txt[index]
@staticmethod
def decimation(x):

View File

@ -59,16 +59,16 @@ class FilterBank:
xs_all = [xs_d1, xs_d4, xs_d16, xs_d64, xs_d256]
for xs in xs_all:
nominals = []
nominals_txt = []
firs = np.empty((self.L, len(xs)), order='F')
for i, x in enumerate(xs):
# These are the filters that do not require lasp_decimation
# prior to filtering
nominals.append(self.nominal(x))
nominals_txt.append(self.nominal_txt(x))
firs[:, i] = self.createFilter(fs, x)
filterbank = {'fb': pyxFilterBank(firs, 1024),
'xs': xs,
'nominals': nominals}
'nominals': nominals_txt}
self.filterbanks.append(filterbank)
# Sample input counter.

View File

@ -44,7 +44,7 @@ for x in bands.xs:
ax.semilogx(freq, llim)
ax.semilogx(freq, ulim)
ax.set_title(f'x = {x}, fnom = {bands.nominal(x)}')
ax.set_title(f'x = {x}, fnom = {bands.nominal_txt(x)}')
if zoom:
ax.set_xlim(bands.fl(x)/1.1, bands.fu(x)*1.1)