Waveform distortion assessment in power systems with a new three-step sliding-window method