An intelligent control for three-phase and four-wire active power filter