I would like to ask you what is the sampling frequency. Your signal is periodic with a frequency of 50Hz and it is a repetitive signal. The best way to calculate the harmonic coefficients is to use the Fourier series rather than Fourier transform.
However, the DFT and FFT restricted to the samples of one period of 20 ms will give correct values for the harmonic values. It remains one comment is that you have to sample the waveform by a sampling frequency fs which must be = > 2x the highest harmonic frequency to be observed.
If there is differences in the results of the different calculators remaining, this is due to trunction errors in the calculation process.
In order to get the same results
- the same formula,
- one has to use the same number of data set,
If there is an error, it is then calculation errors.
Best wishes
Note: the sampling frequency is corrected after the answer of Simone. Thank you Simone!
@Lorenzo: Shrinivas samples at 200 kHz and search for harmonics of 50 Hz up to the 50-th order, i.e. 2.45 kHz, so I do not think he has these problems.
@Shrinivas: about Excel formulas, the correct formula for sampling frequency is fs =(R3-1)/R4, because if you have three points, you get two intervals. But easier fs = 1/(An - An-1);
For the rest I agree with Costin Vasile: follows the link.
In particular if you use 4000 points, you will have DFT bins at multiple of 200 kHz/4000 = 50 Hz. So the zero padding is self-defeating.
But the main question is: why make FFT with Excel ??