Determining Fourier Coefficients without Function

fourier analysis

I need to determine the Fourier coefficients that best describe a set of observational data. Now, everything I have read from Wikipedia, Google, and other answers on this site give me many ways of determining the coefficients given a function. However, I don't have a function. All I have are observational data and the time the observation was taken.

What is the proper formulation to use in this case? The only thing I have found that sounds potentially useful is something called a "Discrete Fourier transform," but that seems to give complex values, which is nonsensical for real data. How do I do this?


Edit:

I know precisely what the Fourier coefficients are. They are the $n$ coefficients of the sine and cosine terms that best approximate the function (or data, in this particular case). I learned quite extensively about how to calculate the Fourier series coefficients given a function (integrating them with the function and a sine or cosine term) in my graduate-level Math Methods course (I'm a PhD student in astrophysics). The problem is that that doesn't help when I don't have a function to insert into the integral, so I'm asking how to find them when I don't have a function.

Best Answer

Put your data in a vector y, and USE Y=fft(y) in MATLAB, you will get the result Y.

If you want Y be real, use Y=dct(y).