I am working on a project to determine the distortion in a sine wave signal. To do this I need to find the rms voltage of the fundamental signal(50Hz) as well as that of the harmonics. This would be need to be done up to the 9th harmonic at 450Hz using an Uno.
My first thought was to use an FFT to calculate the voltage at each frequency and then sum them together, however I wasn't sure if the Uno was capable due to limited memory which I believe limits it to 128 samples. The number of bins would be half the number of samples and this would span the frequency range of half the sampling rate. So I could use an anti-aliasing filter with a cutoff of 500Hz and a stopband at 1Khz, then sample at 2Khz.
This Would give a frequency interval of 1000/64 ~15Hz.
Could I then sum up the bins containing the 50Hz signal, ie The 3rd and 4th to cover the signal from 30-60Hz?
A second solution I thought of was to sample the entire waveform up to 500Hz and find the rms voltage with and without the fundamental signal, using a notch filter. This could be done digitally or use an analogue filter.
I would welcome some advice.