Classification of sags according to their origin based on the waveform similarity