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;
- and
- filtering the intermediate signal using an adjustable length filter to obtain the magnitude and the phase of the input signal, wherein a length of the adjustable length filter varies based at least in part on a period measurement of the power system.