Harmonic detection is very important in the control of Active Power Filters (APFs). This paper presents a technique for harmonic identification, based on moving average filters (MVAs) and heterodyning, very suitable for digital implementation. The approach of fundamental component identification is contributed both for single-phase and three-phase voltage/current systems. Selective harmonic identification is also feasible.Due to the rapid step-response, good harmonic/noise cancellation of MVAs, and good frequency adaptation of the proposed algorithms, they have a very good performance compared with other alternatives.Experimental results of digital implementation in a rapid prototyping platform (dSpace DS1103), including an APF prototype are contributed proving the theoretical approaches. Details and experimental results of FPGA implementation, a clear trend in the field of digital control, are also contributed.