exa.core.util.esprit.esprit

Contents

exa.core.util.esprit.esprit#

esprit(data, window=None, model_size=None, eps=None)#

ESPRIT method.

Estimate parameters assuming data is a sum of complex exponentials: \(\Sigma_n A_n \exp (2 \pi i f_n) + N\) where \(N\) is noise.

\(n\) is estimated:

  • by some AIC-based guess based on the RSS after denoising

  • if eps is given: by truncating based on singular values (throw away smallest SVD making up fraction esp of sum of all SVDs)

  • if model_size is given: n = model_size

Parameters:
  • data (ndarray) – A 1-d array of data points.

  • window (int | None) – the averaging window used for denoising. Should be at least a few n, usually the default (len(data) // 2) is a good choice, but can be reduced to speed up if data is large.

  • model_size (int | None) – If given, forces \(n\) in the model.

  • eps (float | None) – Fraction of smallest SVDs to discard in model size estimation.

Returns:

  • Array of estimated frequencies \(f_n\). For oscillating decaying components, two values occur as a complex pair \((2 \pi i T - f, 2 \pi i T + f)\); for purely decaying components, a single imaginary value \(2 \pi i T\) occurs, where the real part \(f\) is the frequency and the imaginary part corresponds to the decay constant.

  • Array of corresponding amplitudes \(A_n\). The phase of the complex amplitudes correspond to the phase of the sine.

  • Model data corresponding to \(f_n\) and \(A_n\).

Return type:

tuple[ndarray, ndarray, ndarray]