Algorithmic development for power quality monitoring by a network of wireless sensors