Shunt active power filters are the most viable solution for solving current harmonic, reactive power compensation, and load unbalancing problems widely presented in electrical distribution systems. In this article, development and implementation of a digital signal processor based three-phase four-wire shunt active power filter are analyzed to compensate non-linear and unbalanced loads under non-ideal supply voltages conditions. The proposed algorithm is divided into two parts, the first associated with the calculation of the positive-sequence component of unbalanced supply voltage and second deriving a simple and attractive fundamental extraction filter to extract the fundamental frequency component from distorted positive-sequence voltage. Average power and DC-link energy balance methods are used to calculate peak value of the supply current, which is required to flow from source to load. The behavior and effectiveness of the proposed control algorithm has been verified by simulation using MATLAB/Simulink (The MathWorks, Natick, Massachusetts, USA) environment for different cases of supply voltage. A laboratory prototype has been developed to verify the simulation results. The control scheme is realized using a TMS320F28335 floating-point digital signal processor (Texas Instruments, Dallas, Texas, USA) based system. It is found that simulated and experimental harmonic spectral performances are in compliance with the recommendations about harmonic limits imposed by the IEEE-519 Standard.