<div dir="ltr">Dear Dorothy,<div><br></div><div>First of all, use pop_eegfiltnew(). Strongly recommended.</div><div><br></div><div>If you want to match wavelet transform results to FFT results in the freq domain, you have to have loooooong cycles. I have ran the experiment several years ago, and if I had cycle == 20 or around the freq domain plot of the newtimef results (i.e. averaging across time points) matched the curve of FFT in 8-13 Hz. The default cycle is 3, not 20, so the results should be quite different. This is due to time-frequency trade off in the wavelet transform.</div><div><br></div><div>Makoto</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 3:00 AM, Carlos Andrés Guerrero M. <span dir="ltr"><<a href="mailto:cguerrero76@yahoo.com" target="_blank">cguerrero76@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:14pt"><div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:14pt"><div><span>Dear Dorothy.<br><br>Just some comments.<br>* </span><span>newtimef script calculates the mean of log spectral across the epochs. <br>* spectopo uses pwelch for psd's calculation for a single input time series.<br>* pop_eegfilt makes a filtering in time domain. NOT frequency domain (as
above). <br> <br></span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>I have tested with my EEG data and I obtained similar results between spectopo and typical PSD analysis. For example,<br><br>mydata=EEG.data(7,:,:); % EEG channel<br>[spectra,freqs] = spectopo(mydata, 0,200,'plot','off'); % this script uses Welch estimation<br>myspec=pwelch(mydata,512,0,1024,200); % psd computation by Welch. <br>% (data, windowlength,overlap,ffftsize,fsampling)<br>figure,plot(spectra)<br>figure,semilogy(myspec)<br> <br>I think that differences are oriented to how the methods calculate the psd. About newtimef.m, I have more doubts about it, but I suposse it could be the same. <br><br>Best<br></span><br clear="none">Carlos Guerrero-Mosquera<br clear="none"><span>Research Centre of Cognition and Neurosciences </span><span>(CRNC)</span><span><em></em><em></em><em></em>-UR2NF<br clear="none">Bruxelles</span></div> <div> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:14pt"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt"> <div><div><div class="h5"><div dir="ltr"> <font face="Arial"> On Wednesday, September 10, 2014 6:01 PM, Dorothy Bishop <<a href="mailto:dorothy.bishop@psy.ox.ac.uk" target="_blank">dorothy.bishop@psy.ox.ac.uk</a>> wrote:<br clear="none"> </font> </div> <br clear="none"><br clear="none"> </div></div><div><div><div class="h5"><div>
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div><font size="3">Dear All</font></div>
<div><font size="3"> </font></div>
<div><font size="3">I am trying to compute power in the mu frequency range, 8-13 Hz.</font></div>
<div><font size="3">I've tried 3 different methods for doing this which I thought would be broadly equivalent: However, for the same data, I get very different results depending on the method I use.</font></div>
<div><font size="3">If results were just a linear transform of one another, I would not be bothered, but it’s more serious than that.</font></div>
<div><font size="3">I am comparing power for 5 different conditions, and when I plot the power for each condition, the pattern of results across conditions is completely different depending on what I do.</font></div>
<div><font size="3">I've provided my pared-down scripts below. I'd be grateful if someone could let me know if I’m doing something wrong, or if I've just misunderstood how these functions work. </font></div>
<div><font size="3">I’d be happy to provide fuller examples if need be.</font></div>
<div><font size="3"> I'm running eeglab6.1 with matlabR2009b. Many thanks</font></div>
<div><font size="3"> </font></div>
<div><font size="3">With the identical data, I have tried:</font></div>
<div>%1. Using FFT via newtimef,</div>
<div>%mydata is subset of EEG.data for trials for given condition and electrode, squeezed to 2D</div>
<div>mydata=squeeze(EEG.data(18,:,:));%electrode 18 is C3</div>
<div>cycles=0;</div>
<div>[ersp,itc,powbase,times,freqs]=...</div>
<div> newtimef( mydata,EEG.pnts,[EEG.xmin EEG.xmax]*EEG.srate, EEG.srate, cycles, 'baseline',NaN,'plotitc','off','plotersp','off');</div>
<div>murange = find(freqs>8 & freqs<13);</div>
<div>mypowermean=(mean(ersp(murange,:),2));</div>
<div>allmu=mean(mypowermean)</div>
<div><br clear="none">
</div>
<div> </div>
<div>%2. Using spectopo,</div>
<div>% thisdata is subset of trials from EEG data for 1 electrodes and a given condition</div>
<div>thisdata=EEG.data(18,:,:);</div>
<div>[spectra,freqs] = spectopo(thisdata, 0, EEG.srate,'plot','off');</div>
<div>murange2 = find(freqs>8 & freqs<13);</div>
<div>allmu2 = mean(spectra(murange2),2)</div>
<div> </div>
<div>%3. Computing power from EEG.data after bandpass filtering at 8-13 Hz</div>
<div>% mydata is EEG.data for given electrode and condition, squeezed to 2D</div>
<div>f1=8;f2=13;</div>
<div>EEG= pop_eegfilt(EEG,0,f2, [], [0]); % Low pass filter with cutoff freq f2 Hz</div>
<div>EEG = eeg_checkset(EEG );</div>
<div>EEG= pop_eegfilt(EEG,f1,0, [], [0]); % High pass filter with cutoff freq f1 Hz</div>
<div>EEG = eeg_checkset(EEG );</div>
<div>mydata=squeeze(EEG.data(18,:,:));%electrode 18 is C3</div>
<div>mydamean=mean(mydata,2);</div>
<div>mydavoltsq=mydamean.^2;</div>
<div>myvoltsq=mean(mydavoltsq);</div>
<div>allmu3=10*log10(myvoltsq/10);</div>
<div><br clear="none">
</div>
<div> </div>
<div> </div>
<div><br clear="none">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div><font>
</font><div>Dorothy Bishop, Professor of Developmental Neuropsychology,<br clear="none">
Dept of Experimental Psychology, University of Oxford, OX1 3UD.<br clear="none">
tel <a href="tel:%2B44%20%280%291865%20271369" value="+441865271369" target="_blank">+44 (0)1865 271369</a>; fax <a href="tel:%2B44%20%280%291865%20281255" value="+441865281255" target="_blank">+44 (0)1865 281255</a>;<br clear="none">
WEB: <a rel="nofollow" shape="rect" href="http://www.psy.ox.ac.uk/oscci" style="font-family:Calibri,sans-serif;font-size:15px" target="_blank"><font color="#0070C0">www.psy.ox.ac.uk/oscci</font></a><br clear="none">
Blog: <a rel="nofollow" shape="rect" href="http://deevybee.blogspot.com/" target="_blank">http://deevybee.blogspot.com/</a></div>
<div>Raising Awareness of Language Learning Impairments! See <a rel="nofollow" shape="rect" href="http://www.youtube.com/RALLIcampaign" target="_blank">
www.youtube.com/RALLIcampaign</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><br clear="none"></div></div>_______________________________________________<br clear="none">Eeglablist page: <a rel="nofollow" shape="rect" href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br clear="none">To unsubscribe, send an empty email to <a rel="nofollow" shape="rect" href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a><br clear="none">For digest mode, send an email with the subject "set digest mime" to <a rel="nofollow" shape="rect" href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br clear="none"><br clear="none"></div></div> </div> </div> </div> </div></div></div></div></div><br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.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">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div>
</div>