<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 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="color: rgb(0, 0, 0);">    </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="color: rgb(0, 0, 0);">display(</span>'downsample each channel'<span class="" style="color: rgb(0, 0, 0);">)</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><p class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;">    <span class="" style="color: rgb(37, 153, 45);">    </span><br class="webkit-block-placeholder"></p><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=""><img apple-inline="yes" id="FB8BFB74-CC77-46A5-A57A-12228AD806CE" src="cid:B0DAD142-AB36-44AD-BE9F-44EEAF25BDD2@guest.UGent.be" class=""></div></div><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=""></body></html>