This paper presents a nonlinear least squares method for measuring the power system frequency, wherein the voltage at the measurement point is modeled by using the Fourier series. The estimation of the fundamental frequency is a nonlinear problem in this formulation and is solved by performing a 1-D search over the range of allowed frequency variation. The voltage signal is used for frequency estimation because it is typically less distorted than the line current, resulting in computational efficiency. The robustness of this algorithm with respect to change in various parameters is studied through simulation and the results are validated by hardware implementation using a Virtex IV field-programmable gate array. An application of this algorithm to a shunt active power filter is also presented. © 2009 IEEE.