Generalized harmonic least-squares amplitude and phase estimation method
An optimisation approach which aims at minimizing the sum of the squared residuals when fitting sinusoids of known frequencies to a time series of discrete measurements. Also included is a windowed linear detrend function with optional window overlap for pre-processing of non-uniformly sampled data.
Both of these functions are located in the HALS.py script and a use-case example can be found in the Jupiter Notebook HALS_example.ipynb
[1] Stoica Petre, Moses R. L. (2005). Spectral Analysis of Signals. Upper Saddle River, New Jersey 07458. Pearson Prentice Hall, ISBN 0-13-113956.
[2] Stoica, Petre, Jian Li, & Hao He. (2009). Spectral Analysis of Nonuniformly Sampled Data: A New Approach Versus the Periodogram. IEEE Transactions on Signal Processing, 57(3), 843–858. https://doi.org/10.1109/TSP.2008.2008973