Search code examples
fftnp

Why np.fft.rfft() does not take sampling rate as an argument?


I am really a beginner in this area, and I couldn't find any related answers. I have read that the frequency resolution of the answer will be fs/N where fs is the sampling rate and N is the length of the input. So the function should take fs as an argument, right? Or is it because it is not needed in the computation? So for different sampling rates, I will get the same outputs for the same inputs?


Solution

  • An FFT or RFFT computation does not take sample rate as an argument because the transform produces the same (dimensionless) result vector for the same (dimensionless) input vector, independent of any frequency or sample rate.

    An FFT can even be used data unrelated to sample rate, such as a mathematical orthogonal basis transform, or IFFTs.