I am having an issue with numpy fft not giving me the expected amplitude in the fft plot. This only happens for certain periods as input.
I am using a clean sine signal with a period of 25 points over 240 datapoints.
The np.fft.rfft gives a peak of 24.

I am wondering what may cause this. I would think clean signal should produce a dirac-delta function like result around 25. I get this type of result for certain periods, but not all. Is there a need for more repetitions of this period in order to specify the period accurately? this does not make sense to me. The fft is done in the following way, where y=my sine datapoints with period 25:
fft = np.fft.rfft(y)
fft = abs(fft)
x=np.fft.rfftfreq(len(y),d=1./1)
x = 1/x # to convert from freq to periods. T = 1/f
plt.plot(x,fft)