Automatic Power Factor Correction with Harmonic Filtering