[![Conda Version](https://img.shields.io/conda/vn/conda-forge/llckbdm.svg)](https://anaconda.org/conda-forge/llckbdm)
[![PyPI](https://badge.fury.io/py/llckbdm.svg)](https://pypi.org/project/llckbdm)
[![Build Status](https://travis-ci.com/danilomendesdias/llckbdm.svg?token=k6Bj4q2Uy7XrcNrLebfL&branch=master)](https://travis-ci.com/danilomendesdias/llckbdm)
[![Build Status](https://dev.azure.com/danilomendesdias/LLC-KBDM/_apis/build/status/danilomendesdias.llckbdm?branchName=master)](https://dev.azure.com/danilomendesdias/LLC-KBDM/_build/latest?definitionId=4?branchName=master)
[![codecov](https://codecov.io/gh/danilomendesdias/llckbdm/branch/master/graph/badge.svg?token=eOpnwCvmIt)](https://codecov.io/gh/danilomendesdias/llckbdm)

## Line List Clustering Krylov Basis Diagonalization Method
This library implements a noise-robust version of Krylov Basis Diagonalization Method (KBDM) [1, 2] for solving the Harmonic Inversion Problem (HIP) by exploiting the method instability in the presence of noise and making use clustering techniques.

An ensemble of solutions for the same input signal is generated by varying the number of input points to be considered or adding a very small quantity of noise (pseudo-noise). 
Estimations of each component are grouped by non-supervised machine learning algorithms in this ensemble and average values of each cluster are used as final estimations.

The idea of using average values in the parameter domain was firstly shown in [3] and a first naive implementation of LLC-KBDM was proposed in [4].

### Instalation

#### conda-forge (recommended)
```
conda install -c conda-forge llckbdm
```
#### PyPI
```
pip install llckbdm
```


[1] Mandelshtam, V. a., & Taylor, H. S. (1997). Harmonic inversion of time signals and its applications. The Journal of Chemical Physics, 107(17), 6756. https://doi.org/10.1063/1.475324

[2] Mandelshtam, V. A. (2001). FDM: The filter diagonalization method for data processing in NMR experiments. Progress in Nuclear Magnetic Resonance Spectroscopy, 38(2), 159–196. https://doi.org/10.1016/S0079-6565(00)00032-7

[3] Silva, D. M. D. D., Lima, T. S., Tannús, A., Magon, C. J., & Paiva, F. F. (2015). MRS data quantification through the KBDM: reducing the effect of noise by using multiple signal truncations. Proceedings of the ISMRM 23rd Annual Meeting & Exhibition, 1967–1967. Toronto.

[4] da Silva, D. M. D. D., Vaz, Y., & Paiva, F. F. (2015). MRS data deconvolution through KBDM with multiple signal truncation and clustering: Circumventing noise effects. In IFMBE Proceedings (Vol. 51, pp. 1022–1025). https://doi.org/10.1007/978-3-319-19387-8_249
