Automatic detection of eCAP thresholds