Waveform analysis