time shift in mtmconvol?
Tom Holroyd
tomh at KURAGE.NIMH.NIH.GOV
Sun May 29 19:21:50 CEST 2005
I've been working with time-frequency plots made with mtmconvol.
I'm using adapted t-f windows as shown below, and I've noticed that my peak ERD
and ERS appear to be moving in time depending on the time window width.
Here's part of the script, after preprocessing:
cfg = [];
cfg.output = 'pow';
cfg.method = 'mtmconvol';
N = 6; # number of cycles per time window
K = 4; # number of tapers (amount of smoothing)
cfg.foi = 2:.25:20;
n = length(cfg.foi);
cfg.t_ftimwin = zeros(1, n);
cfg.t_ftimwin(:) = N ./ cfg.foi;
cfg.tapsmofrq = zeros(1, n);
cfg.tapsmofrq(:) = cfg.foi .* ((K + 1) / (2 * N));
cfg.keeptrials = 'no';
[freq] = freqanalysis(cfg, data);
cfg = [];
cfg.baseline = [-.4 .4];
cfg.baselinetype = 'relative';
fr = freqbaseline(cfg, freq);
The plots show fr.powspctrm(1,:,:), that is, just one channel.
There are 116 trials in each average, and time 0 is peak flexion of a thumb
movement.
In the first figure, the array of 4, the N parameter above is the only thing
that changes, starting with a value of 2 in the upper left, and taking on values
of 3, 4, and 5 for the upper right, lower left, and lower right, resp. The
second figure is for N = 6.
Since the t-f windows are functions of frequency, they also get narrower in
bandwidth as the time width is stretched. The (K+1)/(2*N) factor ensures that
the W parameter to dpss is always a multiple of 1/2. I'm not sure why that is a
requirement in general, but I should also note that I'm doing all these
computations using Octave, not Matlab, and the dpss.m file I'm using fails to
converge properly if W is not a multiple of 1/2.
Anyway, there's a very obvious shift in the positions of the peaks, as a
function of N.
Is there some problem with the way the padding is being done? I thought that
the toi specified the centers of the time windows, so I didn't expect any shifts
of this kind. Or are N = 2, 3, simply too small? The apparent shift might be a
result of too much smoothing when N is small, perhaps.
Thanks in advance for any insights you could give me.
P.S. The latest CVS of Octave (2.9.3) will run fieldtrip, at least for CTF
datasets and t-f plots. I haven't tested all of it, and there are some extra
functions you need. I'll make them available on my website soon; email me if
you can't wait.
--
Dr. Tom Holroyd
"A man of genius makes no mistakes. His errors are volitional and
are the portals of discovery." -- James Joyce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mlc11b.png
Type: image/png
Size: 548248 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20050529/fcb15d5f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mlc11c.png
Type: image/png
Size: 152220 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20050529/fcb15d5f/attachment-0003.png>
More information about the fieldtrip
mailing list