From 95f297dd461e9568800e49700775f91ebc647bca Mon Sep 17 00:00:00 2001 From: "J.A. de Jong" Date: Mon, 1 Oct 2018 14:22:15 +0200 Subject: [PATCH] Small improvements. Legend position forwarded. --- lasp/__init__.py | 3 --- lasp/filter/__init__.py | 4 ++++ lasp/filter/bandpass_fir.py | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lasp/__init__.py b/lasp/__init__.py index 54bf4e6..e69de29 100644 --- a/lasp/__init__.py +++ b/lasp/__init__.py @@ -1,3 +0,0 @@ -from .wrappers import * -from .lasp_tools import * -from .lasp_common import * \ No newline at end of file diff --git a/lasp/filter/__init__.py b/lasp/filter/__init__.py index e69de29..fbd1687 100644 --- a/lasp/filter/__init__.py +++ b/lasp/filter/__init__.py @@ -0,0 +1,4 @@ + +from .freqweighting_fir import A, C + +__all__ = ['A', 'Z'] diff --git a/lasp/filter/bandpass_fir.py b/lasp/filter/bandpass_fir.py index f7d7121..ce30654 100644 --- a/lasp/filter/bandpass_fir.py +++ b/lasp/filter/bandpass_fir.py @@ -84,6 +84,14 @@ class FilterBankDesigner: return frsp(fd, freq, fir) + def nominal_txt_tox(self, nom_txt): + """ + Returns the x-value corresponding to a certain nominal txt: '1k' -> 0 + """ + for x in self.xs: + if self.nominal_txt(x) == nom_txt: + return x + raise ValueError(f'Could not find an x-value corresponding to {nom_txt}.') class OctaveBankDesigner(FilterBankDesigner): """