Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • $\begingroup$ (1) I did something similar before I saw this, just to see if a smoothed version of the data looked plausible. This is a bit clunky, but... {times, vals} = Transpose@data; foldtimes = foldTimes[times, per]; newdata = SortBy[Transpose[{foldtimes, vals}], First]; kern = {1, 2, 3, 4, 5, 4, 3, 2, 1}/25; {newtimes, newvals} = Transpose@newdata; smoothvals = ListConvolve[kern, newvals]; smoothtimes = newtimes[[5 ;; -5]]; $\endgroup$ Commented Jun 3, 2021 at 16:43
  • $\begingroup$ (2) Then do: ifunc = Interpolation[Transpose[{smoothtimes, smoothvals}], InterpolationOrder -> 1]; Plot[ifunc[t], {t, .01, per - .01}] and perhaps ft = Fourier[Table[ifunc[t], {t, .01, per - .01, .001}]]; ListPlot[Abs@ft] $\endgroup$ Commented Jun 3, 2021 at 16:44
  • $\begingroup$ (3) Whether this type of smoothing makes sense is a question I cannot answer though. Outside my expertise and also it probably depends on the underlying problem that needs solving. $\endgroup$ Commented Jun 3, 2021 at 16:45
  • $\begingroup$ @Hugh - thanks. That last graph you’ve drawn, if I’ve understood correctly is the components of the Fourier series for example sin(x) + sin (3x)/3 + ... etc. ? $\endgroup$ Commented Jun 3, 2021 at 16:50
  • $\begingroup$ @rdx Yes these are the magnitude and phase of each Fourier component. You might like to work with the real and imaginary parts of the Fourier components and not take their magnitude and phase. See here for some notes on how Fourier works. $\endgroup$ Commented Jun 3, 2021 at 17:12