I was doing some experiments in Matlab, and write this code to experiment with it.
I want to know if it's possible to extract accurate within -+0.01° phase info from samples of an ADC, the matlab FFT function says that we can.
But it's weird somehow: It would get me very accurate results, is it doable in a real-world scenario?
I assumed a 64 Sample per Cycle in my Wave under test.
Here is the matlab code
t=0:2*pi/64:2*pi-2*pi/64; R=sin(t+pi*178.03/180); FFT=fft(R); angle(FFT(2))*180/pi
After this code I start to do some measurements on my real hardware, and I have increased my sample rate to 128 samples per cycle.
I have made some measurements with my system, which is a Cortex M4@200MHz device and an external ADC, I have a precision source injecting voltages and currents to my ADC which is connected to CT and PT's, the first 4 channels are CT’s and the last 4 channels are PT's.
I have injected some sine waves to the system from 40Hz to 400Hz and in the 50Hz zone I have incremented the frequency by 0.1Hz, also I have tested the system with various phase angles with the channels, the sampling frequency of my ADC is 6400 sample/sec and my ADC is a true simultaneous one.
Here is the results, when I extract the phases respect to the V0 channel and in the 50Hz region, with different phases the extracted phase is within good ranges, but as the frequency changes the error would increase.
I have only 128 samples in a full 50Hz cycle and I cannot increase my sample rate higher due to my system's overhead. I have to extract all the phase and frequency of the waves from this 128 samples, roughly 5ms, aside of many other things to calculate.
Feel free to play with these data to see if you could suggest a good enough solution to extract phase and frequency info with under 0.1 degree for phases and 0.01Hz for frequency.
And all the extracted waves are ready to be injected into matlab.
Here you can get the wave files