From 4fde79b64b07d5ba7dd6bbe314e2c4a5d0131041 Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 27 Jan 2023 14:26:44 +0100 Subject: [PATCH] Expanded Octave and ThirdOctave filter banks to lower frequencies --- src/lasp/filter/filterbank_design.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lasp/filter/filterbank_design.py b/src/lasp/filter/filterbank_design.py index 362ebbe..7ca0903 100644 --- a/src/lasp/filter/filterbank_design.py +++ b/src/lasp/filter/filterbank_design.py @@ -172,7 +172,6 @@ class FilterBankDesigner: Args: x: Band designator """ - SOS_ORDER = 5 fs = self.fs @@ -197,6 +196,7 @@ class FilterBankDesigner: (SOS_ORDER-highpass.shape[0], 1)) return np.vstack((highpass, allpass)) # same shape=(SOS_ORDER, 6) + # Regular bands return butter(SOS_ORDER, [fl_n, fu_n], output='sos', btype='band') def firFreqResponse(self, x, freq): @@ -341,7 +341,7 @@ class OctaveBankDesigner(FilterBankDesigner): @property def xs(self): """All possible band designators for an octave band filter.""" - return list(range(-6, 5)) + return list(range(-7, 5)) def band_limits(self, x, filter_class=0): """Returns the octave band filter limits for filter designator x. @@ -404,7 +404,8 @@ class OctaveBankDesigner(FilterBankDesigner): -3: '125', -4: '63', -5: '31.5', - -6: '16' + -6: '16', + -7: '8' } assert len(nominals) == len(self.xs) return nominals[x] @@ -487,9 +488,9 @@ class ThirdOctaveBankDesigner(FilterBankDesigner): fs: Sampling frequency in [Hz] - can be None """ super().__init__(fs) - self.xs = list(range(-16, 14)) + self.xs = list(range(-19, 14)) # Text corresponding to the nominal frequency - self._nominal_txt = [ + self._nominal_txt = ['12.5', '16', '20', '25', '31.5', '40', '50', '63', '80', '100', '125', '160', '200', '250', '315', '400', '500', '630', '800', '1k', '1.25k', '1.6k', '2k', '2.5k', '3.15k', '4k', '5k', '6.3k', '8k', '10k', '12.5k',