Detection of harmonic overvoltage and resonance in AC railways using measured pantograph electrical quantities