<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Hi Jan-Mathijs,<div><br></div><div>thanks for your answer. I attach two examples (512 Hz vs. 500 Hz). The timeline of my trial is the following (in ms): 300+<font color="#ff0000"><b>200</b></font>+67+33+67+500+700. 0 point, to which ERPs are time-locked, is 1200 ms before the end of the trial. The baseline correction that I apply is -367 ms before 0, that is the 200 ms time window highlighted in red. </div><div><br></div><div>Best,</div><div>Valeria</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 5 lug 2019 alle ore 09:27 Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Valeria,<br>
<br>
Your statement ’they do not look the same’ falls into the same category as the statement ‘it does not work’. Please provide a little bit extra information, e.g. by means of a figure.<br>
<br>
Jan-Mathijs<br>
<br>
<br>
> On 4 Jul 2019, at 17:46, Valeria Mongelli <<a href="mailto:valeria.mongelli2@gmail.com" target="_blank">valeria.mongelli2@gmail.com</a>> wrote:<br>
> <br>
> Dear Fieldtrip community,<br>
> <br>
> I am trying to resample my EEG data from 512 Hz to 500 Hz. I am performing the resampling after data epoching, artifact rejection, ICA and baseline correction, and before averaging my ERPs across conditions. I think something goes wrong there, because when I compare the 500 Hz data to the 512 Hz data they do not look the same. I past my code below. My first question is: is that ok to perform resampling after baseline correction? If yes, which are the correct parameters in this situation? I am talking in particular of the demean and detrend paramers. <br>
> <br>
> Any help will be much appreciated.<br>
> Best,<br>
> Valeria<br>
> <br>
> cfg                 = [];<br>
> cfg.channel         = 1:64;<br>
> cfg.lpfilter        = 'yes';<br>
> cfg.lpfreq          = 40; % <br>
> cfg.demean          = 'yes';<br>
> cfg.detrend         = 'yes'; <br>
> cfg.baselinewindow  = baselinewindow;  % Baseline window<br>
> <br>
> data = ft_preprocessing(cfg,data);<br>
> <br>
> % Resample data at 500 Hz<br>
> cfg                 = [];<br>
> cfg.resamplefs      = 500;<br>
> cfg.demean          = 'no';<br>
> cfg.detrend         = 'yes'; <br>
> cfg.baselinewindow  = baselinewindow;  % Baseline window<br>
> cfg.feedback        = 'text';<br>
> cfg.trials          = 'all';<br>
> cfg.sampleindex     = 'no';<br>
> <br>
> data = ft_resampledata(cfg,data);<br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
> <a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>