# FFT with day-periodic data

I have a collection of data: number of hours per day, over the course of several years. I want to create an FFT of this data. Since my sampling rate isn't seconds, but days, I think I have two choices when constructing the FFT. One, I can specify that the sample rate Fs=1/86400 samples per second (86400 seconds in a day.) But I think that's not right. So maybe I can: two, say Fs=7 samples per week, then my resulting FFT has a scale, instead of cycles-per-second, of cycles-per-week. Is this reasonable, or is there a better way to go about doing FFT for daily-periodic data?

## 3 Answers

The basis function of the FFT is a sinusoid that is characterised by Frequency (Phase) and Amplitude. For the frequency to be expressed in Hz, the time unit must be expressed in seconds but there is nothing stopping you using orders of magnitude, like kHz or MHz.

If you are sampling once every 24hr then your sampling frequency is approximately 11.57407 uHz (micro-Hertz) and your Nyquist frequency will be at 5.787035 uHz which, working backwards, is approximately 2 days. This means that you can't "see" cycles that occur more frequently than once every two days.

Assuming that you do an N-point FFT, your resolution is Fs/N and the frequency of each $k^{th}$ ($0<=k<=N$) bin is $k \times \frac{Fs}{N}$.

Continuing with the data as above and assuming a convenient $N=128$ point FFT, at $k=0$ is your DC point, that is, a constant value underlying your quantity (a constant "number of hours per day"), at $k=1$ you are at $1 \times 11.57407uHz/128 \approx 0.090422 uHz$ or, working backwards, at approximately 1 cycle every 4.2 months. The next bin is at $2 \times 11.57407uHz/128$ or at approximately 1 cycle every 2.1 months and so on.

Of course, this is just the time-scale, you will also be assessing the strength of the sinusoid at each time-scale to get an accurate image of how does your quantity of "number of hours in a day" really fluctuates across time.

Two final notes:

• In fields such as sea tides analysis or astronomy, certain time scales have specific names, instead of reporting XYZ uHz. For example, diurnal (daily), semi-diurnal cycles and so on. For more information please see this, this and this link.

• Make sure that you double check the sort of accuracy required when reporting these figures. A difference of 1 at the scale of magnitude of uHz is approximately two hours (1.90998).

Hope this helps.

Saying "7 samples per week" is perfectly reasonable. The FFT doesn't care how the rate is defined, it only requires it to be constant.

When I fiddle with really low rates, I use the same concept. Say, samples per minute or samples per year.

Mathematically, it doesn't matter. You know yourself that the number 1/86400 samples per second is mathematically the same as 7 samples per week - you calculated them both, after all.

The only effect it will have is in how you translate the FFT bins into a frequency - and you have to do that anyway, regardless of how you represent the sampling rate.

For myself, I find it easier to think of the numbers and samples when represented as some whole number of samples per time unit.

you have a sampling period Ts of 1 day per sample = 3600*24 seconds per sample, from which you can obtain your samping frequency as Fs = 1/Ts in physical hertz units and multiply it by 2*pi for getting angular frequency of sampling...