Arrangements for reducing harmonics from ac input or output