Detection of Partial Discharges at Square Shaped Voltages