I have been working quite a bit with fourier transforms in python the last couple of days.
I have discovered that in order to accurately capture known periods of incoming data, the resolution or spacing of the x-axis (1/n_samples) has to be sufficiently small. Typically this is done by zero-padding the incoming data. (I have also tried windowing, but with no additional effect)
I have an issue related to this: I have specified that i have a period of 128 in a dataseries of 500. I.e. a frequency of 0.0078125. In order to find the correct peak at 0.0078125 in my fft, i need a resolution that is <<0.0078125, which I have made sure of. I am however missing my peak of 0.0078125 by quite a bit. And in the period-axis, the result is even more obvious. Is there anyone who can help me understand why?