Fast Fourier Transform using numpy
Answers to Your Questions


You are right that your time instants are spaced at an interval of $T$. Hence, the sampling rate is $1/T$. ($T$ is defined in line 3 of your code.) You are also right that the second parameter of np.fft.fftfreq() is the sampling interval $T$. I am, however, not sure why you get wrong results when setting $T=100\,\text{Hz}$.
This phenomenon is called aliasing. Nyquist's sampling theorem states that frequencies below $f_\text{s}/2=\frac{1}{2T}$ can be captured correctly by the sampling process. Frequencies above half of the sampling frequency are mirrored back to frequencies below half of the frequency. Therefore, a frequency of $1080\text{Hz}$ is too high to be captured correctly.
The choice for the second parameter of the FFT, the FFT length, depends on the specific application. You have to experiment what leads to the best results. Still, your choice of NFFT = 1024 is typically a good start.