From 3c0562cee4c790f520cc8b2c0ebfe6a2ab7cf957 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong" Date: Fri, 21 Sep 2018 09:16:58 +0200 Subject: [PATCH] Renamed nominals to nominals_txt --- lasp/filter/bandpass_fir.py | 10 +++++----- lasp/lasp_octavefilter.py | 6 +++--- test/bandpass_test_1.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lasp/filter/bandpass_fir.py b/lasp/filter/bandpass_fir.py index 308b644..f7d7121 100644 --- a/lasp/filter/bandpass_fir.py +++ b/lasp/filter/bandpass_fir.py @@ -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): diff --git a/lasp/lasp_octavefilter.py b/lasp/lasp_octavefilter.py index 4a970c4..f8cf038 100644 --- a/lasp/lasp_octavefilter.py +++ b/lasp/lasp_octavefilter.py @@ -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. diff --git a/test/bandpass_test_1.py b/test/bandpass_test_1.py index 6f4884b..499cc34 100644 --- a/test/bandpass_test_1.py +++ b/test/bandpass_test_1.py @@ -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)