list_of_norm_energy = sqrt(Total energy of EEG trial)/std(eegtrial) sort_energy = sort(list_of_norm_energy) Apply an adaptive threshold based on the session level. From meeting with @marco-congedo, @qbarthelemy