<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks Stephen (and Julian who replied at the same time).</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I suspected it was something along these lines as indeed when I subtract one condition from the other, the figures look much more like traditional swirly depictions. <span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">The
 paper I am replicating does not mention anything re. baseline correction of results but I guess that's what they must have done. </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Just glad to know that all makes sense! Many thanks</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Stephen Whitmarsh <stephen.whitmarsh@gmail.com><br>
<b>Sent:</b> 10 January 2019 5:35 PM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] time frequency data looks blocky and stripy rather than smooth and swirly</font>
<div> </div>
</div>
<div>
<div dir="ltr">Dear P.,
<div><br>
</div>
<div>I suspect this is because:</div>
<div>1) you are using half a second for your sliding time-window, which is reasonable, but only have 1.5 seconds of data, of which you plot only one. This doesn't give much room for 'fuzzyness' in the sense of changes over time.</div>
<div>2) because you are not baseline correcting the results, you will mosly see 1/f power, i.e. more power in the lower frequency bands, which will be relatively stronger than any changes over time.</div>
<div><br>
</div>
<div>To solve this:</div>
<div>1) calculate the TFR over a longer time-window, both before and after stimulation onset.</div>
<div>2) use a relative baseline correction</div>
<div><br>
</div>
<div>That should hopefully give you the fuzzyness you want.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Stephen</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr">On Thu, 10 Jan 2019 at 06:14, Poppy Watson <<a href="mailto:popwatson@hotmail.com">popwatson@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div lang="EN-AU">
<div class="x_gmail-m_-3917479869236669112WordSection1">
<p class="x_MsoNormal"><span lang="NL">Dear fieldtrippers,<u></u><u></u></span></p>
<p class="x_MsoNormal"><span lang="NL"><u></u> <u></u></span></p>
<p class="x_MsoNormal">I’m replicating a study that used fieldtrip for TF analysis (and has some lovely single electrode TF plots  for each experimental condition). I’ve been running ft_freqanalysis using the following settings.<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg = [];</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.trials  = trialsToUse;
</span><span style="font-size:13pt; font-family:"Courier New"; color:forestgreen">% this is a vector of trial numbers</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.method =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'mtmconvol'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.output =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'pow'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.channel =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'eeg'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.taper =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'hanning'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.foi = 2:2:30;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:forestgreen">%cfg.t_ftimwin    = 4 ./ cfg.foi;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.t_ftimwin    = ones(length(cfg.foi),1).*0.5;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.toi = -1.25:0.10:0.25;  
</span><span style="font-size:13pt; font-family:"Courier New"; color:forestgreen">% 100 ms sliding time window
</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">            </span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal">The output and stats  etc seem to all make sense but my concern is that when I plot the data e.g. from one electrode (collapsed across the whole pp group)– I don’t get beautiful fuzzy TF graphs – instead I get very blocky/stripy figures
 like the attached where there doesn’t seem to be any smoothing/bleeding across different frequencies. I’ve tried playing around with the cfg.foi as well as the length of the time window and sliding window (cfg.t_ftimwin and cfg.toi) but the results always
 look very blocky rather than all warm and fuzzy (i.e. as seen in raw-TFdata-of-single-electrode images in various publications). Am I missing some smoothing parameters??<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">This is my singleplot_TFR code:<u></u><u></u></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg = [ ] ;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.channel      =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'FCz'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.xlim         = [-1 0];
</span><span style="font-size:13pt; font-family:"Courier New"; color:forestgreen">%before stimulus appears</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.ylim         = [2 20];
</span><span style="font-size:13pt; font-family:"Courier New"; color:forestgreen">% [8 12] only alpha</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.zlim = [0 15];</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.maskstyle    =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'saturation'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">cfg.masknans =
</span><span style="font-size:13pt; font-family:"Courier New"; color:rgb(160,32,240)">'yes'</span><span style="font-size:13pt; font-family:"Courier New"; color:black">;</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><span style="font-size:13pt; font-family:"Courier New"; color:black">ft_singleplotTFR(cfg, allPPdata_suc_collapsed_high);</span><span style="font-size:12pt; font-family:"Courier New""><u></u><u></u></span></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
<p class="x_MsoNormal">Many Thanks<u></u><u></u></p>
<p class="x_MsoNormal">P. Watson<span style="font-size:12pt; color:black"><u></u><u></u></span></p>
<p class="x_MsoNormal"><u></u> <u></u></p>
</div>
</div>
_______________________________________________<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>
</div>
</body>
</html>