<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=NL link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Dear all, I have the following question<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I want to compare the powerspectra in two
conditions for individual channels.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>When I first run freqanalyis with <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.output =
'pow';<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.method =
'mtmconvol';<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.keeptrials = 'yes';<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>this results in a power spectrum for two
conditions:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>size(A.powspctrm):
943 1 19 48 ntrials
x nchannels x nfrequency x ntime<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>size(A.cumtapcnt): 943 19<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I can then compare the powerspectra in two
conditions by running freqstatistics with:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg = [];<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.method = 'analytic';<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.statistic = 'indepsamplesT';<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>ntrl1 = size(A.powspctrm,1);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>ntrl2 = size(B.powspctrm,1);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>design = zeros(1,ntrl1 + ntrl2);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>design(1,1:ntrl1) = 1;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>design(1,(ntrl1+1):(ntrl1+ntrl2)) = 2;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.design =
design;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.ivar
= 1; % independent variable<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>stat = freqstatistics(cfg,A, B);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>differencepowspctrm = stat.stat;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>However, when I use freqanalyis with <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>cfg.output =
'fourier';<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>this results in a fourier spectrum for two
conditions:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>size(A.fourierspctrm):
4715 1
19 48 (ntapers (in my
case 5) x ntrials) x nchannels x nfrequency x ntime<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>size(A.cumtapcnt) :
943 1<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Can I input these fourier spectra directly
to freqstatistics or should I convert the fourierspectrum first to a
powerspectrum (I assume this could be done by taking abs(fourierspectrum).^2
and then averaging over tapers for every trial ) ?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Alternatively, is it at all possible to
first run freqdescriptives and then input the averages and variance into
freqstatistics (since this is the only thing necessary for the independent
t-test)?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Many thanks in advance, best, Jasper<o:p></o:p></span></p>
</div>
</body>
</html>
<p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p> http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p> http://www.ru.nl/fcdonders/fieldtrip/</p>