The shunt active power filter (SAPF) is a widely used tool for compensation of disturbances in three-phase electric power systems. A high number of control methods have been successfully developed, including strategies based on artificial neural networks. However, the typical feedforward neural network, the multilayer perceptron, which has provided effective solutions to many nonlinear problems, has not yet been employed with satisfactory performance in the implementation of the SAPF control for obtaining the reference currents. In order to prove the capabilities of this simple neural topology, this work describes a suitable strategy of use, based on the accurate estimation of the Fourier coefficients corresponding to the fundamental harmonic of any distorted voltage or current. An effective training method has been developed, consisting of the use of many distorted patterns. The new generation procedure uses random combinations of multiple harmonics, including the possible nominal frequency deviations occurring in real power systems. The design of the generation of reference signals through computations based on the Fourier coefficients is presented. The objectives were the harmonic mitigation and power factor correction. Practical cases were tested through simulation and also by using an experimental platform, showing the feasibility of the proposal.