In the control strategies for an Active Power Filter, determination of harmonic components of the load current is the most important stage. We propose a model-based method to extract the harmonic components of the load current in a three-phase three-wire load, where we solve the Fourier synthesis equations using the nonlinear least squares estimation method. The system is considered to contain only harmonic distortions. The proposed algorithm also takes care of fluctuations in the supply frequency. The advantage of this technique over other methods is that it can generate all the harmonic currents explicitly. It is shown through simulation results that the algorithm generates the references quickly with minimum delay under dynamic load conditions. This reduces the burden on the active power filter. Further, the results obtained with non-sinusoidal supply voltage are also satisfactory.