EEG segmentation for improving automatic CAP detection