A tangible, non-transitory, computer-readable medium comprising instructions, wherein the instructions, when executed by processing circuitry, are configured to cause the processing circuitry to perform operations comprising:
- obtaining electrical measurements of an input signal of a power system, wherein the electrical measurements are obtained at a sampling frequency and the input signal is indicative of an operating frequency of the power system;
- generating an intermediate signal from the input signal by multiplying quadrature signals with the input signal, wherein the intermediate signal has a direct current (DC) component indicative of a magnitude and a phase of the input signal;
- storing the intermediate signal comprising in phase and quadrature components in a first-in-first-out (FIFO) buffer;
- and
- filtering the intermediate signal using an adjustable length rounded-corner boxcar filter comprising a plurality of taps to obtain the magnitude and the phase of the input signal, wherein a length of the adjustable length rounded-corner boxcar filter varies based at least in part on a period measurement of the power system, and wherein end taps of the plurality of taps are interpolated to a lesser value than all other taps of the plurality of taps.