ScriptLab: extracting the average pulse waveform