<div dir="ltr">Hi Ron, hi Vera,<div><br></div><div>to align the timepoints for events such as heel strikes over trials you can time warp the data by using a linear interpolation function. If you are looking at the time domain such as for ERPs you can do this on the EEG signal directly.</div><div><br></div><div>If you want to look at time-frequency transforms such as ERSPs you have to first compute the power spectra over a sliding latency window to generate single trial spectograms and then timewarp those single trial spectograms (In this case it is important that you only timewarp AFTER frequency transform - if you would timewarp the original EEG signal you would change the frequencies of the signal). </div><div><br></div><div><br></div><div>You can do this with the function newtimef() in eeglab. The function has the option to pass event latencies which to warp, see below an example for time warping ERSPs.</div><div><br></div><div><br></div><div><div>You can also look at two of my papers where I applied this method:</div><div><br></div><div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:13px"><a href="https://scholar.google.com/scholar?oi=bibs&cluster=4948743302371897780&btnI=1&hl=en" style="color:rgb(102,0,153);text-decoration-line:none">Level of participation in robotic-assisted treadmill walking modulates midline sensorimotor EEG rhythms in able-bodied subjects</a></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:13px">J Wagner, T Solis-Escalante, P Grieshofer, C Neuper… - Neuroimage, 2012</div></div><div style="font-size:13px;margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif"><br></div><div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:13px"><a href="https://scholar.google.com/scholar?oi=bibs&cluster=677406708496801761&btnI=1&hl=en" style="color:rgb(102,0,153);text-decoration-line:none">Distinct β band oscillatory networks subserving motor and cognitive control during gait adaptation</a></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,sans-serif;font-size:13px">J Wagner, S Makeig, M Gola, C Neuper, G Müller-Putz - Journal of Neuroscience, 2016</div></div></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>%% load data</div><div><div>EEG = pop_loadset( ['Audiowalk_S01_cuewalk_PsynchCycleGAMMA.set'],[mypath]);</div><div><br></div><div>%%get event latencies for right and left steps</div><div><br></div><div>RHonS = [500 1500] % </div><div>LHonS = [100 1000]</div><div><br></div><div><br></div><div> [RH] = eeg_getepochevent(EEG , '101', RHonS, 'latency'); </div><div> [LH] = eeg_getepochevent(EEG , '201', LHonS, 'latency'); </div></div><div><br></div><div>%create matrix with event latencies</div><div><div>offset = zeros(size(1:EEG.trials));</div></div><div><div>EVENTLAT = [offset' LH' RH']</div></div><div><br></div><div>%% create vector with latencies that you want to warp the events to</div><div>NEWLAT = mean(EVENTLAT,1);</div><div><br></div><div><div>[ersp, itc, powbase, times, freqs, eboot, pboot, tfdata] = newtimef(EEG.icaact(IC,:,:), EEG.pnts, [EEG.xmin EEG.xmax]*1000, EEG.srate, 0, 'cycles', [3 0.5], 'tlimits', [-1000 3000], 'freqs', [1 150], 'timesout', 500, 'timewarp', [EVENTLAT], 'timewarpms', [NEWLAT], 'baseline',[0 2000], 'plotitc', 'off', 'padratio', 8);</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-01 14:57 GMT-07:00 Croce, Ronald <span dir="ltr"><<a href="mailto:Ronald.Croce@unh.edu" target="_blank">Ronald.Croce@unh.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="font-size:10pt">
<div dir="ltr" style="margin-top:0;margin-bottom:0">Joanna and Scott, I have a similar problem. I want to compare high-velocity visuomotor processing to that of slow-velocity processing. So, completion time will be different in each condition. Could one do
a trial-by-trial analysis and then descriptively compare? Or, in some way statistically compare?</div>
<div dir="ltr" style="margin-top:0;margin-bottom:0"><br>
</div>
<div dir="ltr" style="margin-top:0;margin-bottom:0">Thanks</div>
<div dir="ltr" style="margin-top:0;margin-bottom:0"><br>
</div>
<div dir="ltr" style="margin-top:0;margin-bottom:0">Ron C.</div>
</div><div><div class="h5">
<div style="font-size:10pt">
<div dir="auto" style="margin-top:0;margin-bottom:0"><br>
</div>
<div dir="auto" style="margin-top:0;margin-bottom:0">------ Original message------</div>
<div dir="auto" style="margin-top:0;margin-bottom:0"><b>From: </b>Scott Makeig</div>
<div dir="auto" style="margin-top:0;margin-bottom:0"><b>Date: </b>Thu, Jun 1, 2017 4:26 PM</div>
<div dir="auto" style="margin-top:0;margin-bottom:0"><b>To: </b>Johanna Wagner;</div>
<div dir="auto" style="margin-top:0;margin-bottom:0"><b>Cc: </b><a href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">eeglablist@sccn.ucsd.edu</a>;</div>
<div dir="auto" style="margin-top:0;margin-bottom:0"><b>Subject:</b>[Eeglablist] Fwd: [SCCN Contact Form] EEGLAB</div>
<div dir="auto" style="margin-top:0;margin-bottom:0"><br>
</div>
</div>
<div>
<div dir="ltr">Johanna - Could you answer? -Scott
<div><br>
<div class="gmail_quote">---------- Forwarded message ----------<br>
From: <b class="gmail_sendername">Vera Kooiman</b> <span dir="ltr"><<a href="mailto:g.m.kooiman@student.rug.nl" target="_blank">g.m.kooiman@student.rug.nl</a>></span><br>
Date: Thu, Jun 1, 2017 at 2:33 AM<br>
Subject: [SCCN Contact Form] EEGLAB<br>
To: <a href="mailto:eeglab@sccn.ucsd.edu" target="_blank">eeglab@sccn.ucsd.edu</a><br>
<br>
<br>
Dear Sir/Madam,<br>
<br>
My name is Vera Kooiman and momentarily I am working on my master thesis, measuring EEG in healthy participant walking with a lower-limb dummy prosthesis.<br>
I am using EEGLAB to analyse my data, but had a question, which I could not find an answer for online. I am trying to compare two different condition (normal walking vs walking with a prosthesis) using the ERSP in a STUDY. But during normal walking, the epoch
(step cycle) duration is smaller (1 sec) than during walking with a prosthesis (1.5 sec). It is not possible to compare these condition because the epochs are not consistent. But is it possible to, for instance, scale the ERSP plots to similar lengths and
still compute the statistical differences? We do not wish to scale the data, because this changes the frequencies in the data and therefore the result in the ERSP plots.<br>
I hope you can help me with this problem. Thank you in advance.<br>
<br>
Kind Regards,<br>
Vera Kooiman<br>
<br>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_2105739425019808602gmail_signature">Scott Makeig, Research Scientist and Director, Swartz Center for Computational Neuroscience, Institute for Neural Computation, University of California San Diego, La Jolla CA 92093-0961,
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__sccn.ucsd.edu_-7Escott&d=DwMFaQ&c=c6MrceVCY5m5A_KAUkrdoA&r=7bhzVHb0FKniMoqi5xsidg&m=RCtJFgN-lwltfbZPGUixEAcGe1hskNS0iRzsHUheYro&s=N0PuOeFgmaH8Hz0rzknJdVgTqFxpxzCtWhXoU-oAoGo&e=" target="_blank">
http://sccn.ucsd.edu/~scott</a></div>
</div>
</div>
</div>
</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>