Improved synchronous detection algorithm and its active power filter