# Sampling rate vs sampling time of FFT

I am having some trouble understanding the sampling time and frequency used in the computing of the FFT, and I was wondering if someone could make it clear for me :

• The Sampling time: the time in which I took my sample for example 5 minutes, its the difference between the time at which i started taking measures and the time when I was done.
• The sampling rate: how many samples do I save per second, which means if I took $N$ sample within $13\textrm{ s}$, my Sampling rate will be $f_s=N/13$.

Is this sampling rate the same as the frequency used when calculating the FFT when creating the frequency axis of the FFT?

• Sampling rate (or frequency as I prefer) is indeed used for calculation of frequency vector in FFT.
– jojek
May 4, 2016 at 8:28
• @Mehdi, not satisfied with the answers below, or are you maybe looking for something more specific ? Jun 3, 2016 at 9:23
• @Gilles No, i am satisfied, I understood what i wanted. Thank you ! Jun 3, 2016 at 10:31
• @Mehdi, great ! You're welcome. :) Jun 3, 2016 at 10:37

The sampling time is the time interval between successive samples, also called the sampling interval or the sampling period, and denoted $T$.

The sampling rate is the number of samples per second. It is the reciprocal of the sampling time, i.e. $1/T$, also called the sampling frequency, and denoted $F_s$.

The frequency axis for the FFT is linked to the number $N$ of points in the DFT and the sampling rate $F_s$. It is defined as $f=k\cdot\frac{F_s}{N}$. With $k$ going up to $N$

• how do I get the number of points?
– Ben
Feb 7, 2020 at 10:28
• @Ben it is the number of discrete samples in your FFT. Feb 7, 2020 at 11:57
• @Ben the number of points in your fft is for you to decide depending on the dynamic of your signal. You could take 1300. But normally you’d take the next power of 2 greater than that, e.g. 2048. Feb 7, 2020 at 15:41
• @Ben you basically have one sample every 1 hour (or 1/3600 sec), your $F_s = 1/3600 \rm Hz$. With the choice of the number of FFT point, you will visualize your spectrum with a resolution of only $F_s /N$ . Play with that to observe what you want. Feb 7, 2020 at 15:59
• I did today(?!): The upper arrow is highlighted :)
– Ben
Feb 10, 2020 at 11:10

When you calculate the Discrete Fourier Transform of a signal, if you have N samples as an input, you calculate two half-sized arrays which are N/2+1 values long.

It implies that when sampling at Fs, you cannot represent frequencies that are higher than Fs/2.

So the frequency axis resulting of a FFT cannot be higher than Fs/2.

• if I am sampling a current that has a frequency of 25 KHz and my sampling rate is 30 Hz, does this mean i cannot detect signals in my current that have a frequency higher than 15Hz? May 4, 2016 at 8:27
• How does it answer the question?
– jojek
May 4, 2016 at 8:27
• Mehdi : yes. If you do a FFT in the conditions you are explaining, you will not be able to reconstruct the 25 Hz signal if the initial data had a 30 Hz sampling rate. @Jojek : That is what I understood from Mehdi's question : "Is this sampling rate the same as the frequency used when calculating the FFT when creating the frequency axis of the FFT?" means for me "Is this sampling rate the same as the frequency axis of the FFT". From Mehdi's answer above it seems to me that it was the kind of information he was looking for. If not, Mehdi maybe you can clarify the question ? May 4, 2016 at 8:59
• I believe that Gilles got his point.
– jojek
May 4, 2016 at 9:13
• Possibly. The reference to the frequency axis let me to think the way I explained, but without it I agree that Gilles' answer is more accurate. May 4, 2016 at 10:33