How can I find the FFT of a time series when the samples are not equally spaced?

F
Farrahakhtar · Mar 5, 2021 · 2.3K views
Question
I would like to find the FFT of a time series with nonuniformly spaced samples.  
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Aug 13, 2026

### How to Perform FFT on Unequally Spaced Time Series Data in MATLAB

When dealing with unequally spaced time series data, you need to interpolate the data to ensure all samples are equally spaced before applying the FFT. Follow these steps:

1. Interpolate Data with INTERP1:
   Use the `INTERP1` function to interpolate between the sampled points.
   
   - X: Original data points (sample locations)
   - Y: Magnitudes at those points
   - XI: New equally spaced sample points

2. Apply FFT:
   Pass the interpolated data to the `FFT` function to obtain the frequency spectrum.

Example Steps:

1. Interpolate the Data:
   
   interpolatedData = interp1(X, Y, XI);
   
2. Perform FFT:
   
   fftResult = fft(interpolatedData);
   

Important Note:
Interpolating the data is an approximation and may result in some loss of resolution.

By following these steps, you can efficiently compute the FFT for unequally spaced time series data in MATLAB. This approach ensures accurate frequency analysis after proper data interpolation.

Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!