New method for measuring the stochastic properties of corona and partial discharge pulses