File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 LorentzianModel ,
1818 VoigtModel ,
1919)
20- from sigima .tools .signal .fourier import sort_frequencies
20+ from sigima .tools .signal .fourier import fft1d
2121from sigima .tools .signal .peakdetection import xpeak
2222
2323from datalab .config import _
@@ -291,6 +291,20 @@ def fitfunc(x, params):
291291# --- Sinusoidal fitting curve ------------------------------------------------
292292
293293
294+ def sort_frequencies (x : np .ndarray , y : np .ndarray ) -> np .ndarray :
295+ """Sort from X,Y data by computing FFT(y).
296+
297+ Args:
298+ x: X data
299+ y: Y data
300+
301+ Returns:
302+ Sorted frequencies in ascending order
303+ """
304+ freqs , fourier = fft1d (x , y , shift = False )
305+ return freqs [np .argsort (fourier )]
306+
307+
294308def sinusoidalfit (x : np .ndarray , y : np .ndarray , parent = None , name = None ):
295309 """Compute sinusoidal fit
296310
You can’t perform that action at this time.
0 commit comments