Adaptive Prony method for waveform distortion detection in power systems