I often work with FFT and I like the fft function from Matlab a lot:
However, recently I encoutered a possible problem with the current implementation of Matlab:
In the standard calculation of the frequency axis that I extracted from the above link:
f = Fs*(0:(L/2))/L;
Fs is the sampling frequency and L is the length of the signal, it seems that the frequency step (the distance between two consecutive frequencies in the frequency axis) is Fs/L. This is usually not a problem if L is large enough, for example in this case. However, when I deal with small L, for example L = 5, then I realize that the frequency step is actually not the inverse of the total time window, which it should theoretically be. If I want to do this theoretically perfect, I had to use Fs/(L-1) but then this is not compatible with how the fft is done in Matlab, i.e. I got inconsistency of frequency peaks' position. It seems to me that the fft was not implemented with "perfect theoretical consideration".
Could you please advise/comment? Or you think I missed something?
Thanks and best regards,