Thanks for the response! Much appreciated. Actually, I already have the phase and frequency measurements implemented using the DFT, and more specifically, the Goertzel algorithm which is an IIR filter that essentially achieves a single bin DFT.
We have an A/D for each input channel so all signals are sampled and converted at the same time. We also have our sampler locked to the GPS IRIG signal so we know which sample corresponds to the one second roll-over from the GPS. All phase measurements are referenced to a cosine that starts at the one second roll-over. These phase measurements are called Synchrophasors.
There is a specification for the dynamic behavior of the system to various inputs, such as harmonics, interharmonics, noise, frequency steps/sweeps etc. My implementation using frequency domain methods does not pass the spec for two main reasons:
- Spectral Leakage - The input frequency can vary from 55Hz to 65Hz. When the input frequency moves away from 60Hz, the phase estimate loses accuracy because of the sinc function side-lobes. I added code to either throw away or add in samples in the Goertzel dynamically to make one complete period fit in the measurement window. I call it LineLock. This helps a lot but the error is still too large, for example between adding n samples or n+1 samples. For example, if the frequency increases above 60HZ, there is a point where it is good to throw away one sample because the line cycle is finishing sooner. As the frequency continues to increase, there comes a time where is is good to throw away two samples. The frequency between throwing away one sample and two samples has some spectral leakage. By the way, windowing does not solve the problem because it degrades the phase measurement too much.
- Noise - The Goertzel is excellent to filter out harmonics and out of band noise but any noise at the fundamental causes noise in the phase measurement.
The specification is so tight it is almost impossible to meet. The frequency measurement accuracy must be within 0.005Hz over the 55Hz to 65Hz range. Requirements for frequency step inputs drastically limit the amount of filtering that can be used.
My hope is to add in some time-domain statistical methods to augment or maybe replace the estimation using Goertzel. I'm trying to up my math skills to the point of seeing if the Kalman filter or some such can help. This leads me to my desire to understand the significance of the angle between two vectors. For example the angle between the previous measurement window, (previous 80 samples), and the current measurement window, (most recent 80 samples). Can this help me to deduce the phase change? If the input frequency is 60Hz, the angle seems like it should be zero because the two vectors would be the same. If the frequency deviates from 60Hz, the two vectors would begin to change and the angle would change. I'll try this with some data but I would like to have the intuition of what the angle really is.
Thanks!