It is not the most accurate option, but the easiest would be to take the dft (discrete Fourier transform, function is called fft as it chooses the fast version of it can) after linear or quadratic interpolation of your data to a uniform grid. 

There are ways to compute the Fourier series on a non-uniformed sampled time series (mostly, the response to a specific frequency) but you need to be careful with the results. 

Treat it as noisy data though, as the interpolation will introduce some noise into the spectrum (it is possible to analyze what kind of noise with some work if it is important, depends what information you hope to get from the output)

On Apr 12, 2022, at 10:34, ashwin .D <winash12@gmail.com> wrote:


Hi Robert,
                  Thanks for your prompt response. I am going to try both. Regarding this answer that you recommended - https://stackoverflow.com/questions/34428886/discrete-fourier-transformation-from-a-list-of-x-y-points/34432195#34432195

what would be my angular frequencies from this API - https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lombscargle.html

The x and y arguments are straightforward and are available to me from the CSV file. What about the third one ? 



On Tue, Apr 12, 2022 at 9:48 AM Robert Kern <robert.kern@gmail.com> wrote:
On Mon, Apr 11, 2022 at 11:38 PM ashwin .D <winash12@gmail.com> wrote:
Hello,

My question is somewhat similar. I have data from a CSV file that has measurements of a mean sea level pressure. The data is available every 5 minutes. That means 8928 sample points over a month. But during a hurricane event there was a power failure and only 8867 data points are available. I am short by 61 points to get a uniformly spaced sample.  I am wanting to take an FFT of the data in order to check for periodicity, waves and frequencies there of. What are my best options ? 
 
The first SO answer is reliable (the second is mostly useless for the kind of gap you are talking about); the Lomb-Scargle periodogram is a very reasonable way to do the task. To answer those questions, you will likely want a periodogram, not the more fundamental Fourier transform. But if you do want a full complex-valued Fourier transform for whatever reason, `nfft` should do the job:


--
Robert Kern
_______________________________________________
SciPy-User mailing list -- scipy-user@python.org
To unsubscribe send an email to scipy-user-leave@python.org
https://mail.python.org/mailman3/lists/scipy-user.python.org/
Member address: winash12@gmail.com
_______________________________________________
SciPy-User mailing list -- scipy-user@python.org
To unsubscribe send an email to scipy-user-leave@python.org
https://mail.python.org/mailman3/lists/scipy-user.python.org/
Member address: laughingrice@gmail.com