Automatic recognition of EPG waveforms