On-line digital measurement for the quality analysis of power systems under nonsinusoidal conditions