<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Jan-Mathijs, <div class=""><br class=""></div><div class="">So indeed I confirm that I have checked and there were no NaNs after the downsampling procedure. For clarification, I do the following steps (code below)</div><div class=""><br class=""></div><div class="">I do basically the following:</div><div class="">1) downsampling (datall —> No NaNs)</div><div class="">2) bandpass (0.1-40, order 1) </div><div class="">3) re-referencing (<span style="font-family: Courier; font-size: 10px;" class="">AllData_Preprocesses</span> —> No NaNs)</div><div class="">4) spectral interpolation (<span style="font-family: Courier; font-size: 10px;" class="">data_intpl </span>—> No NaNs)</div><div class="">5) ICA (<span style="font-family: Courier; font-size: 10px;" class="">data </span>—> No NaNs)</div><div class="">6) Epoching —> NaNs appear for just some of them. </div><div class="">7) …</div><div class=""><br class=""></div><div class="">I have checked and after each step of the processing of my data structure, there is not a single NaN. I have also attached a print screen of the « data »  structure and a data browser.</div><div class=""><br class=""></div><div class=""><b class="">Then goes the epoching</b>. For some triggers, there are actually values in each epoch. But for some other triggers, they are replaced by NaN, but just at the moment of the epoching. While in the trialinfo, the triggers do exist.</div><div class=""><br class=""></div><div class="">Of course, the code is exactly the same for each different trigger. When I remove the downsampling phase from my preprocessing, this problem does not happen and I can preprocess my data without future issues. I can’t figure out why, based on a similar structure, some triggers give NaN while other not, something which does not happen when I don’t downsample. And it seems to change from one participant to another (i.e. the data which disappear from some triggers). </div><div class=""><br class=""></div><div class="">Please find below the full code. I have tried two methods: the one you suggested with datr{i}.time = datr{1}.time; but the result is the same and the one below with downsampling as a first step.</div><div class=""><br class=""></div><div class="">Could it be that the downsample function removes, in a way or another, data point but also triggers if they happen to happen at specific data points?</div><div class=""><br class=""></div><div class="">Thank you for the help, </div><div class=""><br class=""></div><div class="">Emilie</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">bpfilterOrder = 1; <span style="color: #25992d" class="">% ft default</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">bpfilterRange = [.1 40];</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class="">% % Event details</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">windows     = [-0.2, 1.3]; </span>% get trials from -.70 ms to 200 ms.</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">baselines   = [-0.2 0]; </span>% Baseline from -.70 ms to -.50 ms.</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45); min-height: 12px;" class=""> </p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">ERPtrialN = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">ERPs = [];</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><br class=""></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span style="color: #0433ff" class="">for</span> s=1</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class="">    </div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    thisSubj = subjID{s};</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    subjPath = [eegPath  thisSubj];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    file = dir([subjPath  <span style="color: #b245f3" class="">'*.bdf'</span>]);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(178, 69, 243);" class=""><span style="color: #000000" class="">    fprintf(</span>'\n\n ************** Processing Subject %s **************\n\n '<span style="color: #000000" class="">, thisSubj(2:end));</span></div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><br class=""></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.dataset = [file.name];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    datp         = ft_preprocessing(cfg);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.resamplefs = 512;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.demean          = <span style="color: #b245f3" class="">'no'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    fg.detrend         = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.trials          = <span style="color: #b245f3" class="">'all'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.feedback        = <span style="color: #b245f3" class="">'text'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    datall = ft_resampledata(cfg, datp);</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><br class=""></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.bpfilter    = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.bpfreq      = bpfilterRange;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.bpfiltord   = bpfilterOrder;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.reref       = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.refchannel  = chansRef;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    allData_preprosses = ft_preprocessing(cfg, datall);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">  </span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    </span>% Spectrum interpolation</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg= [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.dftfilter = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.dftfreq = [50 100 150];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.dftreplace = </span><span style="color: #b245f3" class="">'neighbour'</span><span style="color: #000000" class="">; </span>% implicates spectrum interpolation</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.dftbandwidth = [2 2 2];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.dftneighbourwidth = [2 2 2];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    data_intpl = ft_preprocessing(cfg,  allData_preprosses);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    </p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    </span>%%% Remove mastoids</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg             = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.channel = chansEEG;</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    eegData         = ft_selectdata(cfg, data_intpl);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    </span>% perform the independent component analysis (i.e., decompose the data)</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg        = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.numcomponent = 30;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.method = </span><span style="color: #b245f3" class="">'runica'</span><span style="color: #000000" class="">; </span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    comp = ft_componentanalysis(cfg, eegData);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    </span>% %%ICA</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    figure</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.component = 1:30;       </span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.layout    = </span><span style="color: #b245f3" class="">'biosemi64.lay'</span><span style="color: #000000" class="">; </span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.comment   = <span style="color: #b245f3" class="">'no'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.colormap=colormap(<span style="color: #b245f3" class="">'jet'</span>);</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    ft_topoplotIC(cfg, comp);</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    <span style="color: #25992d" class="">%</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    </span>% % 1 4 15 63</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.layout = </span><span style="color: #b245f3" class="">'biosemi64.lay'</span><span style="color: #000000" class="">; </span>% specify the layout file that should be used for plotting</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.viewmode = <span style="color: #b245f3" class="">'component'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg.colormap=colormap(<span style="color: #b245f3" class="">'jet'</span>);</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    ft_databrowser(cfg, comp);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    STOP</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">    cfg.component = [1,2]; </span>% to be removed component(s)</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    data = ft_rejectcomponent(cfg, comp, eegData);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    finfname  = [subjID{s} <span style="color: #b245f3" class="">'_ICA'</span>];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    save([ finfname <span style="color: #b245f3" class="">'.mat'</span>], <span style="color: #b245f3" class="">'data'</span>, <span style="color: #b245f3" class="">'-v7.3'</span>);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    display(<span style="color: #b245f3" class="">'Epochs'</span>)</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    <span style="color: #0433ff" class="">for</span> e = 1:length(eventLabel)</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(178, 69, 243);" class=""><span style="color: #000000" class="">        fprintf(</span>'\n ********* Processing Event: %s ********* \n '<span style="color: #000000" class="">, eventLabel{e});</span></div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>% % % % % Create the trial definition</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg                     = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.dataset             = [ file.name];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.trialdef.eventtype  = <span style="color: #b245f3" class="">'STATUS'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        cfg.trialdef.eventvalue = [41,42,43,44]; </span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        cfg.trialdef.prestim    = abs(windows(1));</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.trialdef.poststim   = windows(2);</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        epData_cfg              = ft_definetrial(cfg); </div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg                     = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        epData                  = ft_redefinetrial(epData_cfg, data);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class="">        %% Baseline</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg                     = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.demean              = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.baselinewindow      = baselines(e,:);</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        epData                  = ft_preprocessing(cfg, epData);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>%%%%%%%%%%%% ARTEFACTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg             = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.alim        = 100;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.keepchannel = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.layout      = <span style="color: #b245f3" class="">'biosemi64.lay'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>% cfg.method      = 'summary';</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>% cfg.method      = 'trial';</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.method      = <span style="color: #b245f3" class="">'channel'</span>; <span style="color: #25992d" class="">%% Or 'trial'</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.metric      = <span style="color: #b245f3" class="">'var'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        clean_data    = ft_rejectvisual(cfg, epData); </span>%interpolData% Pour rejeter les artefacts (seulement pour donn?es segment?es)</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        cfg.artfctdef.reject = </span><span style="color: #b245f3" class="">'complete'</span><span style="color: #000000" class="">; </span>% Permet de sauvegarder les artefacts rejet?s</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.artfctdef.feedback = <span style="color: #b245f3" class="">'no'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cleandata = ft_rejectartifact(cfg,clean_data);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>%%%%% AVERAGING%%%%%%%%</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg = [];</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.trials = <span style="color: #b245f3" class="">'all'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.covariance = <span style="color: #b245f3" class="">'yes'</span>;</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        cfg.covariancewindow = [-inf 0]; <span style="color: #25992d" class="">%it will calculate the covariance matrix</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>% on the timepoints that are</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>% before the zero-time point in the trials</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">        Imagine_DOUL = ft_timelockanalysis(cfg, cleandata);</div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);" class=""><span style="color: #000000" class="">        </span>%%%%% AVERAGING%%%%%%%%</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    <span style="color: #0433ff" class="">end</span></div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class="">    finfname  = [subjID{s} <span style="color: #b245f3" class="">'_Imagine_DOUL'</span>];</div><div style="margin: 0px; line-height: normal;" class=""><font face="Courier" size="1" class="">    save([ finfname </font><span style="font-family: Courier; font-size: 10px; color: rgb(178, 69, 243);" class="">'.mat'</span><font face="Courier" size="1" class="">], </font><span style="font-family: Courier; font-size: 10px; color: rgb(178, 69, 243);" class="">'Imagine_DOUL</span><font color="#b245f3" face="Courier" size="1" class="">’</font><font face="Courier" size="1" class="">);</font></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span style="color: rgb(4, 51, 255);" class="">end</span></div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">    <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br class=""></p><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;" class=""><img apple-inline="yes" id="E145430D-3354-4463-9139-01AF8781B3E0" src="cid:260C72B9-72DB-496B-B96D-0BCD98F91616@crcn.ulb.ac.be" class=""></div><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""> <img apple-inline="yes" id="A10CE487-3EE7-405F-B080-DE3852AD8641" src="cid:C014955A-9FBF-4FE1-B9A6-E60997C6065B@crcn.ulb.ac.be" class="">       </p><div class=""><img apple-inline="yes" id="1B6A4667-CF78-432D-B830-1A429FDA11DB" src="cid:71F1CC93-63AB-4CAE-B5F6-098C7CFAF3CC@crcn.ulb.ac.be" class=""><img apple-inline="yes" id="89974E98-6DA2-4160-9093-E05E510A4AFC" src="cid:D69C251E-1042-4030-A0EC-E6A88F68798D@crcn.ulb.ac.be" class=""></div><div class=""><img apple-inline="yes" id="F53B7850-71DC-4800-B44C-36D6A4FBEAC4" src="cid:31B78263-8B61-43AA-AA53-1505BF0EC4B8@crcn.ulb.ac.be" class=""></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(178, 69, 243);" class=""><span style="color: black; font-family: Helvetica; font-size: 10pt;" class="">---------------------------------------------</span></div></div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="text-align: start; text-indent: 0px;"><p class="MsoNormal" style="margin-bottom: 6pt;"><span style="font-size: 10pt; font-family: Helvetica; color: black;" class="">---------------------------------------------<br class=""></span><b class=""><span style="font-size: 10pt; color: rgb(39, 136, 214);" class="">Emilie CASPAR</span></b></p><p class="MsoNormal"><b class=""><span style="font-size: 9pt; font-family: Helvetica; color: black;" class="">Associate Professor<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></b></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica; color: black;" class="">Department of Experimental Psychology, Ghent University<br class="">office: Henri Dunantlaan, 2 - Floor 2, Room 94<o:p class=""></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica; color: black;" class="">lab’s website: </span><span style="font-size: 9pt; font-family: Helvetica; color: black;" class=""><a href="https://moralsocialbrain.com/" class=""><span lang="EN-US" style="color: blue;" class="">https://moralsocialbrain.com/</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica; color: black;" class=""> <br class="">personal website: </span><span style="font-size: 9pt; font-family: Helvetica; color: black;" class=""><a href="https://emiliecaspar.home.blog/" class=""><span lang="EN-US" style="color: blue;" class="">https://emiliecaspar.home.blog/</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica; color: black;" class=""><o:p class=""></o:p></span></p><p class="MsoNormal" style="font-size: 12px;"></p><p class="MsoNormal"><span style="font-size: 9pt; font-family: Helvetica; color: black;" class="">Université libre de Bruxelles (office & contact): DB10.138 / +32 2 650 32 95<o:p class=""></o:p></span></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>

<br class=""><div><blockquote type="cite" class=""><div class="">Le 29 oct. 2021 à 14:51, Schoffelen, J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> a écrit :</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
hi Emilie,
<div class=""><br class="">
<div class="">Given the lack of responses so far, I think that nobody has encountered this before. I hope that you inspected your data for NaNs? This is the most likely cause of your problem. Also, your use case seems to be quite an exceptional one, since you
 seem to be reading the channels one at the time (and resample), and then concatenate afterwards, using ft_appenddata. ft_appenddata performs some checks on the sanity of the sampled time axis in order to determine how (and whether) the data can be appended.
 I suspect that in your case, the channels’ sampling might be slightly different from one channel to the next, which becomes numerically not tolerated once the effective sampling rate is reduced too much.</div>
<div class=""><br class="">
</div>
<div class="">Possible solutions:</div>
<div class="">1)  only downsample after concatenation</div>
<div class="">2) impose a numerically identical time axis across channels, e.g. by including a statement datr{i}.time = datr{1}.time; within the for loop.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 29 Oct 2021, at 12:52, Emilie Caspar via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear Fieldtrippers, 
<div class=""><br class="">
</div>
<div class="">Just a follow-up email to know if someone already got this problem of « Invisible trials » after downsampling and has an idea about how to solve the problem.</div>
<div class=""><br class="">
</div>
<div class="">Kind regards, </div>
<div class=""><br class="">
</div>
<div class="">Emilie</div>
<div class=""><br class="">
</div>
<div class=""><span id="cid:2E7F0EFE-DE20-4E77-9C49-5BCF7D41613A@crcn.ulb.ac.be" class=""><Downsampling.001.jpeg></span><br class="">
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px;" class=""><p class="MsoNormal" style="margin-bottom: 6pt;"><span style="font-size: 10pt; font-family: Helvetica;" class="">---------------------------------------------<br class="">
</span><b class=""><span style="font-size: 10pt; color: rgb(39, 136, 214);" class="">Emilie CASPAR</span></b></p><p class="MsoNormal"><b class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">Associate Professor<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></b></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class="">Department of Experimental Psychology, Ghent University<br class="">
office: Henri Dunantlaan, 2 - Floor 2, Room 94<o:p class=""></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class="">lab’s website: </span><span style="font-size: 9pt; font-family: Helvetica;" class=""><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fmoralsocialbrain.com%2F__%3B!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAQY_tczI%24&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942213822%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=rF7Md6zG0ZST7IPvrI%2BSunRYU3vfpFsX%2BwvlLqLlO%2B4%3D&reserved=0" originalsrc="https://urldefense.com/v3/__https://moralsocialbrain.com/__;!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAQY_tczI$" shash="kkcrnhMjrYgLlRi0Oit3uIeAjIdVnfrYabnQY97qPtgPyTSLiQJr6ng1WtDHy1ZHp96c/wGDMHeyhXq200O8Wma9GtguMhuZCDPDuJOkmXOtdZIC9WlAZPqt+iYNok+z183gX4Ko0AaSt13k3uSwnv0eG/+1dhLE+J9zbeaDcaY=" class=""><span lang="EN-US" style="color: blue;" class="">https://moralsocialbrain.com/</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class=""> <br class="">
personal website: </span><span style="font-size: 9pt; font-family: Helvetica;" class=""><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Femiliecaspar.home.blog%2F__%3B!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAkCkgYUk%24&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942223776%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=BuOPHjp%2By9jbnqG0vyPZnwWXNmX3VRGGVtkJOBdhNEQ%3D&reserved=0" originalsrc="https://urldefense.com/v3/__https://emiliecaspar.home.blog/__;!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAkCkgYUk$" shash="BttbGfnPaccoLkU+e0GWp31MdswK4PKZa41hJq/sY4pURz3OQZpuW0UrAZBG4QzV0nUMP0gypcZGLVpN9GooIJd4BfGpuT0Q+DzAuijnS1RgWnTSAXiMwnJeQDnZWSLc+5IaF2PEm/+HEv9cId1t7tNgW5m6tsDmvvxsWSLR/zQ=" class=""><span lang="EN-US" style="color: blue;" class="">https://emiliecaspar.home.blog/</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class=""><o:p class=""></o:p></span></p>
<div style="font-size: 12px;" class=""><br class="webkit-block-placeholder">
</div><p class="MsoNormal"><span style="font-size: 9pt; font-family: Helvetica;" class="">Université libre de Bruxelles (office & contact): DB10.138 / +32 2 650 32 95<o:p class=""></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">Le 21 oct. 2021 à 14:40, Emilie Caspar via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> a écrit :</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear fieldtrippers, 
<div class=""><br class="">
</div>
<div class="">I am trying to downsample my EEG data, originally recorded at 2048 Hz.</div>
<div class=""><br class="">
</div>
<div class="">I run the following code:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg = [];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);">
<span class="" style="">    </span>%cfg.channel = {'A1', 'B2', 'A5', 'B5', 'B6', 'B8', 'A15', 'B20', 'B15', 'B16', 'A13', 'B18', 'A27', 'A28', 'A31', 'A29', 'A30', 'A32', 'B32', 'A21', 'A31', 'B26', 'EXG1', 'EXG2', 'EXG3', 'EXG4'}%'B15';</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.dataset    = [ file.name];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.bpfilter    = <span class="" style="color: rgb(178, 69, 243);">'yes'</span>;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.bpfreq      = bpfilterRange;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.bpfiltord   = bpfilterOrder;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.reref       = <span class="" style="color: rgb(178, 69, 243);">'yes'</span>;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.refchannel  = chansRef;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    allData_preprosses = ft_preprocessing(cfg);</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
    <br class="webkit-block-placeholder">
</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg = [];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.resamplefs = 512;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    data_DS = ft_resampledata(cfg, allData_preprosses);</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
    <br class="webkit-block-placeholder">
</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
    <br class="webkit-block-placeholder">
</div>
<div class="">When I look at individual trials for artefact rejection, something very weird happens. Basically some trials become ‘invisible’ (sorry, I don’t find any other way to describe it), see figure attached. It seems that the data do exit though because
 when I average my visible trials to the invisible ones, it results in an invisible ERPs graph. But when I remove the trials containing the invisible data, an ERP graph does appear (please don’t pay attention to the quality of the data, this is just an example
 without any cleaning).</div>
<div class=""><br class="">
</div>
<div class="">It seems there is a logic to the phenomenon, because if I downsample to 1024Hz (so half of my initial 2048 Hz), only half of my data becomes invisible and if I downsample to 512Hz, a 3/4 of the data becomes invisible.</div>
<div class=""><br class="">
</div>
<div class="">I have tried the same with a different coding, with this time downsampling before filtering as follows, but the output is exactly the same.</div>
<div class=""><br class="">
</div>
<div class="">
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(178, 69, 243);">
<span class="" style="">display(</span>'downsample each channel'<span class="" style="">)</span></div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
        <span class="Apple-tab-span" style="white-space: pre;"> </span>cfgp         = [];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                cfgp.dataset = [file.name];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                cfgr            = [];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                cfgr.resamplefs = 512;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                display(<span class="" style="color: rgb(178, 69, 243);">'Resampling'</span>)</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                <span class="" style="color: rgb(4, 51, 255);">for</span> i= chansAll</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                    cfgp.channel = i;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                    datp         = ft_preprocessing(cfgp);</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                    datr{i}      = ft_resampledata(cfgr, datp);</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                    clear <span class="" style="color: rgb(178, 69, 243);">datp</span></div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                <span class="" style="color: rgb(4, 51, 255);">end</span></div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                cfg = [];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
                datall = ft_appenddata(cfg, datr{:});</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
    <span class="" style="color: rgb(37, 153, 45);">    </span><br class="webkit-block-placeholder">
</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    display(<span class="" style="color: rgb(178, 69, 243);">'Filters'</span>)</div>
<div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
    <br class="webkit-block-placeholder">
</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg = [];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);">
    cfg.dataset    = [ file.name];</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.bpfilter    = <span class="" style="color: rgb(178, 69, 243);">'yes'</span>;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.bpfreq      = bpfilterRange;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.bpfiltord   = bpfilterOrder;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.reref       = <span class="" style="color: rgb(178, 69, 243);">'yes'</span>;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    cfg.refchannel  = chansRef;</div>
<div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
    data_DS = ft_preprocessing(cfg, datall);</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Does anyone have any idea regarding this phenomenon?</div>
<div class=""><br class="">
</div>
<div class="">Thank you in advance!</div>
<div class=""><br class="">
</div>
<div class="">Best regards, </div>
<div class=""><br class="">
</div>
<div class="">Emilie</div>
<div class=""><br class="">
</div>
<div class=""><span id="cid:B0DAD142-AB36-44AD-BE9F-44EEAF25BDD2@guest.UGent.be" class=""><Downsampling.001.jpeg></span></div>
</div>
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="text-align: start; text-indent: 0px;" class=""><p class="MsoNormal" style="margin-bottom: 6pt;"><span style="font-size: 10pt; font-family: Helvetica;" class="">---------------------------------------------<br class="">
</span><b class=""><span style="font-size: 10pt; color: rgb(39, 136, 214);" class="">Emilie CASPAR</span></b></p><p class="MsoNormal"><b class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">Associate Professor<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></b></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class="">Department of Experimental Psychology, Ghent University<br class="">
office: Henri Dunantlaan, 2 - Floor 2, Room 94<o:p class=""></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class="">lab’s website: </span><span style="font-size: 9pt; font-family: Helvetica;" class=""><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Feur01.safelinks.protection.outlook.com%2F%3Furl%3Dhttps*3A*2F*2Fmoralsocialbrain.com*2F%26data%3D04*7C01*7Cemilie.caspar*40ulb.be*7C9eaa583fc9f2496f3d9708d99494a638*7C30a5145e75bd4212bb028ff9c0ea4ae9*7C0*7C0*7C637704188432821811*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C1000%26sdata%3DX9emmQ51jam6Zr*2FzU1ntTu4F*2FAWsPVUwbwMPtsxLOhw*3D%26reserved%3D0__%3BJSUlJSUlJSUlJSUlJSUlJSUlJQ!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAxN_xjhw%24&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942233734%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=97ffhkfBhxqQTqVVe93tJ%2F%2BscIaQbbl2RBAq1Txxo%2Fo%3D&reserved=0" originalsrc="https://urldefense.com/v3/__https://eur01.safelinks.protection.outlook.com/?url=https*3A*2F*2Fmoralsocialbrain.com*2F&data=04*7C01*7Cemilie.caspar*40ulb.be*7C9eaa583fc9f2496f3d9708d99494a638*7C30a5145e75bd4212bb028ff9c0ea4ae9*7C0*7C0*7C637704188432821811*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C1000&sdata=X9emmQ51jam6Zr*2FzU1ntTu4F*2FAWsPVUwbwMPtsxLOhw*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJQ!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAxN_xjhw$" shash="XTxMjldWOtPfp8Q61RadhXTV2Q/qdKwEMmvwzt7dyBY5/MeetngvGAuJd6OpdFruW2xIFdBAgJ0nCdnlE9lKHXr/GdCv/RqQo5nrvTKZJQmAXZEZovt2k+3BwJvYV8QjDYY5YLr6UdN4r58CsrZnYaRw5pI/lC0bbXoIc6r9oHc=" class=""><span lang="EN-US" style="color: blue;" class="">https://moralsocialbrain.com/</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class=""> <br class="">
personal website: </span><span style="font-size: 9pt; font-family: Helvetica;" class=""><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Feur01.safelinks.protection.outlook.com%2F%3Furl%3Dhttps*3A*2F*2Femiliecaspar.home.blog*2F%26data%3D04*7C01*7Cemilie.caspar*40ulb.be*7C9eaa583fc9f2496f3d9708d99494a638*7C30a5145e75bd4212bb028ff9c0ea4ae9*7C0*7C0*7C637704188432831766*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C1000%26sdata%3DRSBTcOxejkzdWKA9QOyJZKXBD*2F5bGyFC12*2FKCpKl8GY*3D%26reserved%3D0__%3BJSUlJSUlJSUlJSUlJSUlJSUlJQ!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAk0r1eNs%24&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942243688%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=k8evpeTT%2FhyMZOCsUHpjOPZW5BR%2FDxmwbB3jPJ9HVUE%3D&reserved=0" originalsrc="https://urldefense.com/v3/__https://eur01.safelinks.protection.outlook.com/?url=https*3A*2F*2Femiliecaspar.home.blog*2F&data=04*7C01*7Cemilie.caspar*40ulb.be*7C9eaa583fc9f2496f3d9708d99494a638*7C30a5145e75bd4212bb028ff9c0ea4ae9*7C0*7C0*7C637704188432831766*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C1000&sdata=RSBTcOxejkzdWKA9QOyJZKXBD*2F5bGyFC12*2FKCpKl8GY*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJQ!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqAk0r1eNs$" shash="K3iYtZFfbsAa+jnoXmH7nU6dfwIpusVy5QVpNUeRnkfmzlzt+noYEapa907ANwOKBTWWigKWTqGWmi8+izcp16AEau4wcATjFFE+f/i7IVk8j4uZjr+SSWx4IPMSKCvBXCo8QTvzebq15rCxqvaT5I+BKmP40HOBKEFuMBLo7yw=" class=""><span lang="EN-US" style="color: blue;" class="">https://emiliecaspar.home.blog/</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica;" class=""><o:p class=""></o:p></span></p>
<div style="font-size: 12px;" class=""><br class="webkit-block-placeholder">
</div><p class="MsoNormal"><span style="font-size: 9pt; font-family: Helvetica;" class="">Université libre de Bruxelles (office & contact): DB10.138 / +32 2 650 32 95<o:p class=""></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942243688%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fssxL2sleRPNFIHBaV6eHJ4fgsa%2B6x5rKhV8n4vYNAQ%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="OyccpA+1cw4UqxNhxLqkHg3SaX3zXhzy6WcasHZoNloIJ4bdw1/kL5rakocxkStsBvBUyXyuYFiL09mF5/yBQK9pBgNo0nCJkSuO30ApXMfJMR+XcDsClehAZn4wj70O81AbqoWDGyd+VrS3C2zgSnvD5SptCzsM+5Vv0rsCN44=" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202__%3B!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqA3PXLTtU%24&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942253648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2FSbbGE9ncIe8ayTRcxDJCRyC%2BsL67pSL6x8ah6%2BzeIA%3D&reserved=0" originalsrc="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqA3PXLTtU$" shash="OXoCtPvJcC2n8Oolvbv9hiCJOcd1kYZ1oJkvwSnMyEbxc+0wYLVJ2QOqh1H57f8/hZ1XvU50b1u0ElIexsnnR7i4dMDGn0ix8mTgZiNSbXfrOfOJRg2mOPViPEl+Dop8/bKCWhuw8KNqSUqF0iwfJEZYPozxT80QYcsxltXbIF8=" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=04%7C01%7Cemilie.caspar%40ulb.be%7Cc85af862d2004c60d8cf08d99ae0a6b2%7C30a5145e75bd4212bb028ff9c0ea4ae9%7C0%7C0%7C637711111942263600%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jGMIbV6xpw%2Bcphs0t8Qn7H7G4w0FoVQ9sZpAwilsKcU%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="k0DyCxT79PwPziPYzDZOHsUIMP+xuK3I4bux9EULm0TO/Wvz8d3UrM14k5jbN9Ak7VvIox7oUo5euziKqnNkk24Cv0vnS+NCMBObEn8jJYD4INQjHaOanYJ3iyHKzisg2bwMqpSNmyIyli924KnIe+ix4ogl3hw4jcWZNmkIsbg=" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqA3PXLTtU$" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!vIs6cDO9UI_eSxJ-ejSlr1oqs47g4UtnsVqQOLcRSfvkRYPZQz1BrYgADkAqrz-vRfTJ2oqA3PXLTtU$</a>
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>

_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">https://doi.org/10.1371/journal.pcbi.1002202<br class=""></div></blockquote></div><br class=""></div></body></html>