How to Fourier Transform (basic understanding) I need to fourier transform my light curve (2nd image) into something which looks like the first graph of the first image. I have very little idea about how to actually do this and I only understand the very basics about fourier transforms (the idea, not the mathematics).

T = 1460 #days
z = fft(y)
f = 1/T 
plot(f,y)


This is my code attempt so far, but I just get a graph with straight lines or nothing at all. If you could help me with this, it would be fantastic :)

The x axis of my light curve is measured in Julian days and the y axis in flux. When I fourier, I want the x axis to be in micro hertz.

Thank you :)
If you want to plot the magnitude of your data you need to calculate first the absolute value as the output of the fft is complex.

z = fft(y);
z_mag=abs(z); % you could also log-tranform the data for db-scale


To get the right x-Axis you need however the sampling rate. Lets assume that the sampling rate at which the data is recored is f_sampling(some number);

Fs=f_sampling;
n=length(z_mag)
freqHz = (0:1:n-1)*Fs/N;


Keep in mind that this is a double-sided spectrum.