Is it possible to use the FFTW package (or any other Julia package) to perform an FFT on non-uniformly-sampled data? It seems that the functions provided in this package all assume uniform sampling.
I have a 1-dimensional time-series (about 8k units long) and an accompanying vector of time values, and I’d like to extract peaks in the frequency.
Note that you want an inverse NFFT here. You can approximate that using an adjoint NFFT but you need to use an additional density compensation (quadrature weights)
Yes the NFFT description will not really question is more a signal processing one and the NFFT will likely only be one building block in getting the correct frequency.
One first question before we can go into detail: Are you aiming for a single frequency or is it that you are looking also at frequency changes over time?
If this is about a single frequency then I see some issues with your signal since it is changing the amplitude over time. So probably you should start doing an NFFT just over that phase where the amplitude remains constant.
A further thing that you will need is a windowing function since your sampling rate will not necessary match to the frequency you are looking for.
If you take these things into account and look at the signal from point 50-120 it seems that the deltaT is pretty small and thus I would start with an FFT to look if you get something in the correct region. Once you have that, you can switch to the NFFT.
I am actually just aiming for a single frequency, corresponding to the constant-amplitude sinusoidal signal after t>≈ 60. I don’t care about the frequency in the early part of the signal, or how it changes with time.
I am sure this is just signal processing 101, but I was under the impression that my Δt being variable will mess things up, for example if I were to average the sampling frequency over the last ~half of the interval. This is why I was looking into non-uniform FFTs. It seems like this won’t be such a big deal, though, and that I should just try to use a regular FFT with, say, an average sampling frequency?
using the NFFT is absolutely the right thing to do here but I wanted to give you some hints on the many other pitfalls one can make here.
What I got is that you are aiming for a single frequency but are you 100% sure that the underlying data really only contains a single frequency? When I look at that data, I would start with a short time Fourier transform (which includes the windowing) and then look at the frequency over time. In a second step you can then exchange the internal FFT by the NFFT. But its important to keep the windowing.