[FieldTrip] Invisible data after ft_resampledata
Emilie Caspar
ecaspar at ulb.ac.be
Fri Oct 29 12:52:37 CEST 2021
Dear Fieldtrippers,
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.
Kind regards,
Emilie
---------------------------------------------
Emilie CASPAR
Associate Professor
Department of Experimental Psychology, Ghent University
office: Henri Dunantlaan, 2 - Floor 2, Room 94
lab’s website: https://moralsocialbrain.com/ <https://moralsocialbrain.com/>
personal website: https://emiliecaspar.home.blog/ <https://emiliecaspar.home.blog/>
Université libre de Bruxelles (office & contact): DB10.138 / +32 2 650 32 95
> Le 21 oct. 2021 à 14:40, Emilie Caspar via fieldtrip <fieldtrip at science.ru.nl> a écrit :
>
> Dear fieldtrippers,
>
> I am trying to downsample my EEG data, originally recorded at 2048 Hz.
>
> I run the following code:
>
> cfg = [];
> %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';
> cfg.dataset = [ file.name];
> cfg.bpfilter = 'yes';
> cfg.bpfreq = bpfilterRange;
> cfg.bpfiltord = bpfilterOrder;
> cfg.reref = 'yes';
> cfg.refchannel = chansRef;
> allData_preprosses = ft_preprocessing(cfg);
>
> cfg = [];
> cfg.resamplefs = 512;
> data_DS = ft_resampledata(cfg, allData_preprosses);
>
>
> 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).
>
> 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.
>
> I have tried the same with a different coding, with this time downsampling before filtering as follows, but the output is exactly the same.
>
> display('downsample each channel')
> cfgp = [];
> cfgp.dataset = [file.name];
> cfgr = [];
> cfgr.resamplefs = 512;
> display('Resampling')
> for i= chansAll
> cfgp.channel = i;
> datp = ft_preprocessing(cfgp);
> datr{i} = ft_resampledata(cfgr, datp);
> clear datp
> end
> cfg = [];
> datall = ft_appenddata(cfg, datr{:});
>
> display('Filters')
>
> cfg = [];
> cfg.dataset = [ file.name];
> cfg.bpfilter = 'yes';
> cfg.bpfreq = bpfilterRange;
> cfg.bpfiltord = bpfilterOrder;
> cfg.reref = 'yes';
> cfg.refchannel = chansRef;
> data_DS = ft_preprocessing(cfg, datall);
>
>
> Does anyone have any idea regarding this phenomenon?
>
> Thank you in advance!
>
> Best regards,
>
> Emilie
>
> <Downsampling.001.jpeg>
> ---------------------------------------------
> Emilie CASPAR
>
> Associate Professor
>
> Department of Experimental Psychology, Ghent University
> office: Henri Dunantlaan, 2 - Floor 2, Room 94
>
> lab’s website: https://moralsocialbrain.com/ <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>
> personal website: https://emiliecaspar.home.blog/ <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>
>
> Université libre de Bruxelles (office & contact): DB10.138 / +32 2 650 32 95
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211029/1d5c8d5d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Downsampling.001.jpeg
Type: image/jpeg
Size: 234266 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211029/1d5c8d5d/attachment-0001.jpeg>
More information about the fieldtrip
mailing list