Power quality analysis in alternating current (ac) networks