Some code relevant to waveform processing