[Eeglablist] Creating epochs related to the gait cycle
Johanna Wagner
joa.wagn at gmail.com
Tue Feb 21 14:53:59 PST 2017
Hi Chesney,
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).
You can use the newtimef() function in eeglab to compute time frequency
transforms and timewarp the results.
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.
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.
you'll have a matrix:
[0 334
0 367
0 368
....
]
You need to provide this matrix as a parameter in newtimef(). You can also
check out the help for newtimef...
See also example code below
Let me know if you have any questions!
Johanna
*timewarping example with newtimef:*
RESPONSEtime = [50 1500] %define time window in which resonse can occur
[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
offset = zeros(size(1:EEG.trials)); %% get a vector of zeroes equal to
the number of trials
RT_LAT = [offset' RT']; %% generate matrix with rows equal trials and
columns equal 0 and RT latencies
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....
[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 2000], 'timesout', 800, 'freqs',
[4 60],...
'timewarp', [RT_LAT], 'timewarpms', [newLat], 'baseline',[-800 0],...
'alpha', 0.05, 'plotitc', 'off', 'padratio', 4);
2017-02-20 1:27 GMT-08:00 Chesney Craig <C.Craig at mmu.ac.uk>:
> Dear Makoto,
>
>
>
> 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.
>
>
>
> Kind regards,
>
> Chesney
>
>
>
> *From:* Makoto Miyakoshi [mailto:mmiyakoshi at ucsd.edu]
> *Sent:* 18 February 2017 02:21
> *To:* Chesney Craig <C.Craig at mmu.ac.uk>; Johanna Wagner <
> joa.wagn at gmail.com>
> *Cc:* eeglablist at sccn.ucsd.edu
> *Subject:* Re: [Eeglablist] Creating epochs related to the gait cycle
>
>
>
> Dear Chesney,
>
>
>
> I included my colleague Johanna Wagner for her advice. Probably you know
> her paper. Johanna, please help us here.
>
>
>
> 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.
>
>
>
> Makoto
>
>
>
>
>
>
>
> On Tue, Feb 14, 2017 at 3:11 AM, Chesney Craig <C.Craig at mmu.ac.uk> wrote:
>
> Hi,
>
>
>
> I would like to create epochs time-locked to each gait cycle, as has been
> done in previous papers (Gwin et al., 2010, 2011).
>
>
>
> 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?
>
>
>
> 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?
>
>
>
> Following this, I assume I should append the epochs to perform ICA?
>
>
>
> Any general advice on creating epochs related to the gait cycle would also
> be greatly appreciated.
>
>
>
> Thanks in advance.
>
>
>
> Kind regards,
>
> Chesney Craig
>
>
>
> Research Associate
>
> Valentine 1-3
>
> Department of Exercise and Sport Science
>
> Manchester Metropolitan University Cheshire
>
> Crewe Green Road
>
> Crewe
>
> Cheshire
>
> CW1 5DU
>
> Tel: 0161 247 5538
>
>
>
> "Before acting on this email or opening any attachments you should read
> the Manchester Metropolitan University email disclaimer available on its
> website http://www.mmu.ac.uk/emaildisclaimer "
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.
> ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
>
>
>
>
> --
>
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
> "Before acting on this email or opening any attachments you should read
> the Manchester Metropolitan University email disclaimer available on its
> website http://www.mmu.ac.uk/emaildisclaimer "
>
--
Johanna Wagner, PhD
http://scholar.google.at/citations?user=vSJYGtcAAAAJ&hl=en
<http://sccn.ucsd.edu/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20170221/efb094d2/attachment.html>
More information about the eeglablist
mailing list