[Eeglablist] Question about removing bad trials

Cedric Cannard ccannard at protonmail.com
Tue Dec 27 08:48:38 PST 2022


Dear Sophie,

You can use the trimoutlier plugin for that. You can install it from the Extension manager.

Alternatively, you could use some code like this using a root mean squared value (RMS) for each epoch for example:
for iEpoch = 1:size(EEG.data,3)
    sigRMS(iEpoch,:) = rms(rms(EEG.data(:,:,iEpoch)));
end
badTrials = find(isoutlier(sigRMS,'gesd'));  % index of bad trials using the gesd method
EEG = pop_rejepoch(EEG, badTrials, 0);  % remove them from data

This detects trials with large amplitude artifacts pretty well, but not trials with high-frequency artifacts. I can send some code for those if you want. 

Cedric



------- Original Message -------
On Monday, December 26th, 2022 at 11:09 AM, Sophie's <sophiehascher at gmail.com> wrote:


> Hi all!
> 
> I am currently starting out with EEGLAB and would need some help with
> removing bad trials. I have opened EEGLAB and am on scroll data. The issue
> I have is that I am not sure how to remove data that is under -150 uV and
> above +150 uV. How can I do this in visual inspection?
> 
> Thanks a lot for your help!
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu



More information about the eeglablist mailing list