<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear list,<div><br></div><div>I am conducting a trialwise LMM analysis on time-frequency data and compared my grand averages between two ft_freqanalysis pipelines for sanity checking. Though the data look qualitatively similar, I noticed the values are baselined roughly 1.5 dB lower (i.e., values around zero vs. -1.5) for the grand averages using the cfg.keeptrials = 'yes' option compared to the cfg.keeptrials = 'no' option.</div><div><br></div><div>Here are the processing steps for the keeptrials = 'yes' dataset:</div><div><br></div><div>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">nSteps = 90;</p>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)">fRange = [1 30]; </span>% Range of frequencies to analyze</p>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)">nCyc = [2 12]; </span>% range of cycle widths for each freq</p></div><div><br></div><div><p style="color:rgb(0,0,0);margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg = [];</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)">cfg.output = </span><span style="color:rgb(160,32,240)">'pow'</span><span style="color:rgb(0,0,0)">; </span>% return power spectra</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.channel = <span style="color:rgb(160,32,240)">'all'</span>;</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)">cfg.method = </span><span style="color:rgb(160,32,240)">'wavelet'</span><span style="color:rgb(0,0,0)">; </span>% multipaper method</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.foi = linspace(fRange(1),fRange(2),nSteps); <span style="color:rgb(34,139,34)">% 1 to 30 Hz in 90 steps</span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.width = linspace(nCyc(1),nCyc(2),nSteps); <span style="color:rgb(34,139,34)">% width of  wavelets in number of cycles</span></p><p style="color:rgb(0,0,0);margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">




</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)">cfg.toi = [-3 3]; </span>% time windows of interest</p><div><br></div><p style="color:rgb(0,0,0);margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.keeptrials = 'yes';</p><p style="color:rgb(0,0,0);margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.baseline = [-.3 0];</p><p style="color:rgb(0,0,0);margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.baselinetype = <span style="color:rgb(160,32,240)">'db'</span>;</p><p style="color:rgb(0,0,0);margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier"><br></p></div><div><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier"><span style="color:rgb(0,0,255)">for</span> i = 1:nSub</p>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"><br></p>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px">     tfDataSLLoCohQ1{i} = ft_freqanalysis(cfg, eeg{bin1,a});</p>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px">            </p>
<p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">     tfNormDataSLLoCohQ1{i} = ft_freqbaseline(cfg, tfDataSLLoCohQ1{i});</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier"><br></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(0,0,255)">end</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(0,0,255);min-height:14px"> </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg = [];</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"> </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">% Get subject averages</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier"><span style="color:rgb(0,0,255)">for</span> j = 1:length(tfNormDataSLLoCohQ1)</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"> </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">    tfNormAvgQ1{j} = ft_freqdescriptives(cfg,tfNormDataSLLoCohQ1{j});</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px">    </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(0,0,255)">end</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(0,0,255);min-height:14px"> </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">% Get grand average</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">tfNormGrandAvgQ1 = ft_freqgrandaverage(cfg,tfNormAvgQ1{:});</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(0,0,255);min-height:14px"><br></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(34,139,34)">% Get theta band for frontocentral sites</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.channel = {<span style="color:rgb(160,32,240)">'Cz'</span>,<span style="color:rgb(160,32,240)">'FC1'</span>,<span style="color:rgb(160,32,240)">'FC2'</span>};</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.avgoverchan = <span style="color:rgb(160,32,240)">'yes'</span>;</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.frequency = [4 8]; </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">cfg.avgoverfreq = <span style="color:rgb(160,32,240)">'yes'</span>;</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;min-height:14px"> </p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">





















</p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier">singleThetaQ1 = ft_selectdata(cfg,tfNormGrandAvgQ1);</p></div><div><br></div><div>In the cfg.keeptrials = 'no' pipeline, all is the same except the option is switched off and the extra step to get descriptives (ft_freqdescriptives) is removed before ft_freqgrandaverage as the trials were discarded so the extra step isn't necessary.</div><div><br></div><div>When I plot the theta time course, all the values in the cfg.keeptrials = 'yes' data are shifted roughly 1.5 units down on the y-axis compared to the cfg.keeptrials = 'no' data.</div><div><br></div><div>Has anyone else experienced a similar issue? Any insight into why these two approaches end up with different results?</div><div><br></div><div>Any help is greatly appreciated. Thank you!</div><div><div><br></div>Best,</div><div><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font color="#000000">Dan McCarthy</font></div></div></div></div></div></div></div></div></div></div></div></div>