more analysis stuff to extract the waveform

added functions to analyse the shape of the waveform