Abstract-Generation of current references constitutes an important part in the control of active power filters (APFs) used in power system, since any inaccuracy in reference currents yields to incorrect compensation. In this paper, two different harmonic detection methods for generating reference currents have been evaluated. The approach is based on the measurement of line currents and performs the compensation of the selected harmonics using closed-loop control. MATLAB/SIMULINK power system toolbox is used to simulate the proposed system. Simulation results show that the dominant harmonics in the line current are reduced significantly and thereby there is a marked reduction in the total harmonic distortion.Index Terms-Active power filters, harmonic compensation, multilevel inverters, non linear loads and power quality.