diff --git a/.readthedocs.yml b/.readthedocs.yml index 07ff00d..849e7b8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -19,5 +19,4 @@ python: install: - requirements: docs/requirements.txt - method: setuptools - path: . - \ No newline at end of file + path: . diff --git a/README.md b/README.md index 5d5cd53..a9ccfb2 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,16 @@ This project implements the Synchronized Swept Sine Method as a reusable python package. It is structured according to the papers by [Novak et al. 2015](https://doi.org/10.17743/jaes.2015.0071) and [Novak et al. 2010](https://doi.org/10.1109/TIM.2009.2031836), but equations and symbol names are adapted to code conventions, also known as PEP 8. -Anyway, references to symbols and equations are given in the code comments. +However, references to symbols and equations are given in the code comments. Most important classes are - `SyncSweep` for the generation of the synchronized swept sine singal - `HigherHarmonicImpulseResponse` for the deconvolution from sweep input and output signal. -- `HammersteinModel` filtering of signals with the hammerstein model. -- `LinearModel` filtering of signals with the linear kernel e.g. from a `HigherHarmonicImpulseResponse` +- `HammersteinModel` estimation and filtering of signals with the hammerstein model. +- `LinearModel` estimation and filtering of signals with the linear kernel e.g. from a `HigherHarmonicImpulseResponse` Examples are placed in the examples folder. +A small example, estimating the coefficients of a nonlinear system, is listed below: ```python import numpy as np diff --git a/examples/example1.py b/examples/example1.py index 004c2d7..f1337e0 100644 --- a/examples/example1.py +++ b/examples/example1.py @@ -95,8 +95,8 @@ ylabel('$\\phi$ / rad') grid() lines = l0 + l1 + l2 + l3 - labels = [l.get_label() for l in lines] + labels = [line.get_label() for line in lines] legend(lines, labels) xlabel('Frequency $f$ / Hz') -show() \ No newline at end of file +show() diff --git a/syncsweptsine.py b/syncsweptsine.py index 5ec2aa8..2d9be9e 100644 --- a/syncsweptsine.py +++ b/syncsweptsine.py @@ -870,7 +870,7 @@ def from_sweeps(cls, syncsweep, measuredsweep, fftlen=None, regularize=1e-6): reguspec = invert_spectrum_reg(rinvspec*sweepspec, beta=regularize) rinvspec[1:] = rinvspec[1:]*reguspec[1:] else: - rspec /= syncsweep.samplerate + rspec /= syncsweep.samplerate return cls.from_spectra( rspec=rspec, rinvspec=rinvspec, @@ -918,7 +918,7 @@ class FrfFilterKernel(object): """ def __init__(self, freq, frf, ir=None): - if len(freq) != len(frf): + if len(freq) != len(frf): raise ValueError('`freq` and `frf` must have the same length, not ', len(freq), len(frf)) self._frf = frf self._freq = freq