[FieldTrip] error with automatic artefact rejection using ft_artifact_threshold

Arnold Kochari a.kochari at uva.nl
Thu Jun 22 12:45:43 CEST 2017


Dear FieldTrip community,



I am new to FieldTrip and got stuck while trying to exactly replicate an
analysis reported in a paper. I would be very grateful for any tips.
Specifically, I cannot manage to automatically reject trials with certain
min/max uV (question 1) and cannot find any way to automatically detect
linear drift (question 2).

*1.* After segmenting and baseline correcting using *demean*, I am trying
to use the following code for rejection of trials with extreme values using
*ft_artifact_threshold*, but I seem to have made a mistake somewhere:

    cfg = [];

    cfg.trl = 'baselined.sampleinfo';

    cfg.continuous = 'no';

    cfg.artfctdef.threshold.min = -75;

    cfg.artfctdef.threshold.max = 75;



    [cfg, artifact] = ft_artifact_threshold(cfg, baselined);


I am getting to following error:

Error using butter (line 79)
butter: first band edge must be smaller than second

Error in ft_preproc_bandpassfilter (line 153)
[B, A] = butter(N, [min(Fbp)/Fn max(Fbp)/Fn]);

Error in preproc (line 327)
if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat,
fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype,
cfg.bpfiltdir, cfg.bpinstabilityfix, cfg.bpfiltdf, cfg.bpfiltwintype,
cfg.bpfiltdev, cfg.plotfiltresp, cfg.usefftfilt); end

Error in ft_artifact_threshold (line 164)
dat = preproc(dat, channel, offset2time(cfg.trl(trlop,3), hdr.Fs,
size(dat,2)), artfctdef);

*2. *I am also trying to detect a linear drift of more than +/- 50 uV
beginning before the onset of the stimulus (so before 0). With this one, I
am not sure where to begin. I would be grateful for tips about what
functions I can use to do this.


Kind regards,
Arnold Kochari
PhD candidate, Institute for Logic, Language and Computation, University of
Amsterdam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170622/4eab3810/attachment-0001.html>


More information about the fieldtrip mailing list