<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=utf-8"><meta name=Generator content="Microsoft Word 15 (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;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Dear Peyton,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>You might want to check this out:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a href="http://www.fieldtriptoolbox.org/walkthrough#input_output_structure_of_ft_freqstatistics">http://www.fieldtriptoolbox.org/walkthrough#input_output_structure_of_ft_freqstatistics</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>And the tutorials on statistic, e.g. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a href="http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq">http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>However, note that doing an FFT has nothing to do with ft_freqstatistics. You need ft_freqanalysis for that and did that just fine with the code you shared (and, as with everything in life, there is not *<b>the</b>* correct way to do anything, but the way you did it should be fine).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Best,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Jörn<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:NL'>--</span></b><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#255A9E;mso-fareast-language:NL'><br>Jörn M. Horschig, PhD</span></b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#626264;mso-fareast-language:NL'>, Software Engineer<br><a href="http://www.artinis.com/" target="_blank"><span style='color:#626264'>Artinis Medical Systems</span></a>  |  +31 481 350 980 </span><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#255A9E;mso-fareast-language:NL'><o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl] <b>On Behalf Of </b>Peyton Finley<br><b>Sent:</b> Thursday, October 29, 2015 16:20<br><b>To:</b> fieldtrip@science.ru.nl<br><b>Subject:</b> [FieldTrip] Fast Fourier Transform Using EEGLab<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hello,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki,<o:p></o:p></p></div><div><p class=MsoNormal>                                  especially cluster-permutation tutorial and the 'walkthrough' design-matrix section)<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>cfg = [];<o:p></o:p></p></div><div><p class=MsoNormal>ft_defaults;<o:p></o:p></p></div><div><p class=MsoNormal>cfg.dataset = dataset;<o:p></o:p></p></div><div><p class=MsoNormal>preprocdata=ft_preprocessing(cfg);<o:p></o:p></p></div><div><p class=MsoNormal>data=struct2single(preprocdata);<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>%% Define cfg for ft_frequanalysis.m and run.<o:p></o:p></p></div><div><p class=MsoNormal>cfg = [];<o:p></o:p></p></div><div><p class=MsoNormal>cfg.output='fourier';<o:p></o:p></p></div><div><p class=MsoNormal>cfg.method='mtmfft';<o:p></o:p></p></div><div><p class=MsoNormal>cfg.outputfile=outputFileName;<o:p></o:p></p></div><div><p class=MsoNormal>cfg.foilim=[0 55]; <o:p></o:p></p></div><div><p class=MsoNormal>cfg.tapsmofrq='2';<o:p></o:p></p></div><div><p class=MsoNormal>[freq]=ft_freqanalysis(cfg,data);<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>%% Define cfg for ft_freqstatistics.m and run.<o:p></o:p></p></div><div><p class=MsoNormal>cfg = [];<o:p></o:p></p></div><div><p class=MsoNormal>cfg.method='analytic';<o:p></o:p></p></div><div><p class=MsoNormal>[stat]=ft_freqstatistics(cfg, freq); <o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Sincerely,<o:p></o:p></p></div><div><p class=MsoNormal>Peyton Finley<o:p></o:p></p></div></div></div></body></html>