# 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 '16 at 8:28
• @Mehdi, not satisfied with the answers below, or are you maybe looking for something more specific ? – Gilles Jun 3 '16 at 9:23
• @Gilles No, i am satisfied, I understood what i wanted. Thank you ! – Mehdi Jun 3 '16 at 10:31
• @Mehdi, great ! You're welcome. :) – Gilles Jun 3 '16 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$

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? – Mehdi May 4 '16 at 8:27
• How does it answer the question? – jojek May 4 '16 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 ? – AdrienP May 4 '16 at 8:59
• I believe that Gilles got his point. – jojek May 4 '16 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. – AdrienP May 4 '16 at 10:33