<div dir="ltr">Hi Chesney,<div><br></div><div>Makoto is right if you want to warp spectral power changes over time, timewarping is only valid after time frequency transform. (Otherwise you would change the frequencies and phase of the original signal).</div><div>You can use the newtimef() function in eeglab to compute time frequency transforms and timewarp the results.</div><div><br></div><div>Your data has to be epoched and you need to provide a matrix with the single trial latencies of the events in each trial you want to warp.</div><div><br></div><div>For example if you epoch relative to a go stimulus and you want to warp the reaction times in each trial to a mean reaction time over trials, you need to get the latency of each RT in each trial eg. 334ms 357ms 368ms... etc.</div><div>you'll have a matrix:</div><div><br></div><div>[0 334</div><div>0 367</div><div>0 368</div><div>....</div><div>]</div><div><br></div><div>You need to provide this matrix as a parameter in newtimef(). You can also check out the help for newtimef...</div><div><br></div><div>See also example code below<br></div><div><br></div><div><br></div><div>Let me know if you have any questions!</div><div>Johanna</div><div><br></div><div><br></div><div><b>timewarping example with newtimef:</b></div><div><div><br></div><div>RESPONSEtime = [50 1500] %define time window in which resonse can occur</div><div><br></div><div><br></div><div> [RT] = eeg_getepochevent(EEG , {'201'}, RESPONSEtime, 'latency'); %% get event latencies relative to 0 in each epoch '201' in this case is the markercode coding the RT</div><div><br></div><div><br></div><div>offset = zeros(size(1:EEG.trials)); %% get a vector of zeroes equal to the number of trials</div><div><br></div><div>RT_LAT = [offset' RT']; %% generate matrix with rows equal trials and columns equal 0 and RT latencies </div><div><br></div><div>newLat = [0 mean(RT)] %% this is the latencies to which you want to warp the single trial latencies to. It's just 2 numbers: 0 and the mean RT - you do not necessarily need to provide this parameter since eeglab warps the latencies per default to mean latencies of the timewarping event, in this case the mean RT....</div><div><br></div><div><br></div><div><br></div><div>[ersp, itc, powbase, times, freqs, eboot, pboot, tfdata] = newtimef...</div><div> (EEG.icaact(IC,:,:), EEG.pnts, [EEG.xmin EEG.xmax]*1000, EEG.srate, 0,...</div><div> 'cycles', [3 0.5], 'tlimits', [-1000 2000], 'timesout', 800, 'freqs', [4 60],...</div><div> 'timewarp', [RT_LAT], 'timewarpms', [newLat], 'baseline',[-800 0],...</div><div> 'alpha', 0.05, 'plotitc', 'off', 'padratio', 4);</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-20 1:27 GMT-08:00 Chesney Craig <span dir="ltr"><<a href="mailto:C.Craig@mmu.ac.uk" target="_blank">C.Craig@mmu.ac.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div class="m_6244300790813149089WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Dear Makoto,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thank you for your assistance. Yes, I have read a lot of Dr Wagner’s papers, so I would be keen to hear her recommendations too. Our
lab is quite new to analysing EEG data, especially mobile EEG.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Kind regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Chesney<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Makoto Miyakoshi [mailto:<a href="mailto:mmiyakoshi@ucsd.edu" target="_blank">mmiyakoshi@ucsd.edu</a>]
<br>
<b>Sent:</b> 18 February 2017 02:21<br>
<b>To:</b> Chesney Craig <<a href="mailto:C.Craig@mmu.ac.uk" target="_blank">C.Craig@mmu.ac.uk</a>>; Johanna Wagner <<a href="mailto:joa.wagn@gmail.com" target="_blank">joa.wagn@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">eeglablist@sccn.ucsd.edu</a><br>
<b>Subject:</b> Re: [Eeglablist] Creating epochs related to the gait cycle<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Dear Chesney,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I included my colleague Johanna Wagner for her advice. Probably you know her paper. Johanna, please help us here.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The time warping is only valid after time-frequency transform, if I understand correctly. If you stretch or shrink raw time series, it changes frequency! When you compute ERSP, there is 'timewarp' option. This can warp the ERSP results,
if it works.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Makoto<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Tue, Feb 14, 2017 at 3:11 AM, Chesney Craig <<a href="mailto:C.Craig@mmu.ac.uk" target="_blank">C.Craig@mmu.ac.uk</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I would like to create epochs time-locked to each gait cycle, as has been done in previous papers (Gwin et al., 2010, 2011).<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">From my understanding, this was done previously by analysing each gait cycle as a single trial, as EEGLAB doesn’t allow epochs of different lengths. Is this correct?
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">These trials were then time-warped so that heel strikes occurred at the same adjusted latencies. However, could anyone provide more detail on how to perform such timewarping and
what this function does? From my reading on the timewarp function, the original time series and warped time series must be the same length. However, I am unclear as to what this means. Does ‘original time series’ refer to your selected gait cycle to model
the others on (e.g. gait cycle 1) and then the function will warp the following gait cycles to the same latencies, which would then result in epochs of the same length?
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Following this, I assume I should append the epochs to perform ICA?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Any general advice on creating epochs related to the gait cycle would also be greatly appreciated.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks in advance.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Kind regards,<u></u><u></u></p>
<p class="MsoNormal">Chesney Craig<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Research Associate<u></u><u></u></p>
<p class="MsoNormal">Valentine 1-3<u></u><u></u></p>
<p class="MsoNormal">Department of Exercise and Sport Science<u></u><u></u></p>
<p class="MsoNormal">Manchester Metropolitan University Cheshire<u></u><u></u></p>
<p class="MsoNormal">Crewe Green Road
<u></u><u></u></p>
<p class="MsoNormal">Crewe
<u></u><u></u></p>
<p class="MsoNormal">Cheshire<u></u><u></u></p>
<p class="MsoNormal">CW1 5DU<u></u><u></u></p>
<p class="MsoNormal">Tel: 0161 247 5538<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">"Before acting on this email or opening any attachments you should read the Manchester Metropolitan University email disclaimer available on its website
<a href="http://www.mmu.ac.uk/emaildisclaimer" target="_blank">http://www.mmu.ac.uk/<wbr>emaildisclaimer</a> "
<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">
http://sccn.ucsd.edu/eeglab/<wbr>eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">
eeglablist-unsubscribe@sccn.<wbr>ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">
eeglablist-request@sccn.ucsd.<wbr>edu</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Makoto Miyakoshi<br>
Swartz Center for Computational Neuroscience<br>
Institute for Neural Computation, University of California San Diego<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div></div></div><div><div class="h5">
"Before acting on this email or opening any attachments you should read the Manchester Metropolitan University email disclaimer available on its website <a href="http://www.mmu.ac.uk/emaildisclaimer" target="_blank">http://www.mmu.ac.uk/<wbr>emaildisclaimer</a> "
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br>Johanna Wagner, PhD<br><div><br></div><div><a href="http://scholar.google.at/citations?user=vSJYGtcAAAAJ&hl=en" target="_blank">http://scholar.google.at/citations?user=vSJYGtcAAAAJ&hl=en</a><br></div><br><a href="http://sccn.ucsd.edu/" target="_blank"></a></div></div></div></div></div></div></div></div></div></div>
</div>