From 4fd065b14535c31c4813c99057eb878cc752bb89 Mon Sep 17 00:00:00 2001 From: Nicolas Franco Gomez <80042895+nico-franco-gomez@users.noreply.github.com> Date: Wed, 6 Mar 2024 10:23:44 +0100 Subject: [PATCH] renamed filter (#52) --- CHANGELOG.rst | 6 +++--- dsptoolbox/__init__.py | 2 +- dsptoolbox/classes/{_vsfilter.py => _svfilter.py} | 9 +++++---- dsptoolbox/filterbanks/__init__.py | 4 ++-- tests/test_filterbanks.py | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) rename dsptoolbox/classes/{_vsfilter.py => _svfilter.py} (97%) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a8cbf49..63ab1f5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,13 +14,13 @@ adheres to `Semantic Versioning `_. - Validation for results from tests in every module (so far many tests are only regarding functionality) -`0.3.2 `_ - +`0.3.3 `_ - --------------------- Added ~~~~~~~ -- added variable state filter `VSFilter` discretized with a topology-preserving - transform +- added state variable filter `StateVariableFilter` discretized with a + topology-preserving transform Misc ~~~~~~ diff --git a/dsptoolbox/__init__.py b/dsptoolbox/__init__.py index 002eddd..ef4802c 100644 --- a/dsptoolbox/__init__.py +++ b/dsptoolbox/__init__.py @@ -73,4 +73,4 @@ "effects", ] -__version__ = "0.3.2" +__version__ = "0.3.3" diff --git a/dsptoolbox/classes/_vsfilter.py b/dsptoolbox/classes/_svfilter.py similarity index 97% rename from dsptoolbox/classes/_vsfilter.py rename to dsptoolbox/classes/_svfilter.py index 4e8fb94..b8ae02e 100644 --- a/dsptoolbox/classes/_vsfilter.py +++ b/dsptoolbox/classes/_svfilter.py @@ -1,5 +1,6 @@ """ -Variable-State filter topology-Preserving (trapezoidal integrators) 2-Pole multimode filter +State variable filter topology-Preserving (trapezoidal integrators) +2-Pole multimode filter """ import numpy as np @@ -10,14 +11,14 @@ from ..generators import dirac -class VariableStateFilter: - """This is a variable state filter discretized using the +class StateVariableFilter: + """This is a state variable filter discretized using the topology-preserving transform (trapezoidal integrator).""" def __init__( self, frequency_hz: float, resonance: float, sampling_rate_hz: int ): - """Construct a variable state, 2-pole multimode filter. The + """Construct a state variable, 2-pole multimode filter. The implementation is based on [1], but the resonance parameter is here equal to 2R. diff --git a/dsptoolbox/filterbanks/__init__.py b/dsptoolbox/filterbanks/__init__.py index a54b1ac..5023516 100644 --- a/dsptoolbox/filterbanks/__init__.py +++ b/dsptoolbox/filterbanks/__init__.py @@ -40,7 +40,7 @@ from ..classes._lattice_ladder_filter import LatticeLadderFilter from ..classes._phaseLinearizer import PhaseLinearizer -from ..classes._vsfilter import VariableStateFilter +from ..classes._svfilter import StateVariableFilter __all__ = [ "linkwitz_riley_crossovers", @@ -52,5 +52,5 @@ "complementary_fir_filter", "LatticeLadderFilter", "PhaseLinearizer", - "VariableStateFilter", + "StateVariableFilter", ] diff --git a/tests/test_filterbanks.py b/tests/test_filterbanks.py index 5418a3e..b27a97d 100644 --- a/tests/test_filterbanks.py +++ b/tests/test_filterbanks.py @@ -169,7 +169,7 @@ def test_phase_linearizer(self): def test_VSFilter(self): fs_hz = 10_000 - f = dsp.filterbanks.VariableStateFilter(500, np.sqrt(2), fs_hz) + f = dsp.filterbanks.StateVariableFilter(500, np.sqrt(2), fs_hz) n = dsp.generators.noise(sampling_rate_hz=fs_hz) f.filter_signal(n)