<html 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=Windows-1252">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Dear Fieldtrip Community,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am using the function ft_freqanalysis to calculate power spectrum and cross spectrum and after that I calculate the Magnitude Squared Coherence.</p>
<p class="MsoNormal">The trials are defined to start from -0.200s up to +0.500s .</p>
<p class="MsoNormal">When I use the function ft_freqanalysis on the whole trial it works fine , Coherence gives values from 0 to 1.</p>
<p class="MsoNormal">But when I try to use it only for the prestimulus period (e.g -0.2s – 0s ) or only to the poststimulus period (e.g 0 : 0.5s) , I think it does not work correctly because the Magnitude Squared Coherence is equal to 1 for all the pairs of
channels .</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Do you know if I can calculate the power spectrum and cross spectrum only for prestimulus period or only to the poststimulus period ?
</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is the script that I am using : </p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg = [];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.output = 'powandcsd';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.method = 'mtmfft';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.foilim = [5 100];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.pad ='nextpow2';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.tapsmofrq = 5;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.keeptrials = 'yes';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.trials = [1] ; <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">freq = ft_freqanalysis(cfg, data );
<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">data have the structured as the output of ft_preprocessing. </p>
<p class="MsoNormal">When I want to select only the prestimulus or post stimulus period I am using :</p>
<p class="MsoNormal"><span style="color:#4472C4">cfg = []; <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.latency = [-0.2 0] ; <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">data_pre = ft_selectdata(cfg,data) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">% select only the post stimulus period 0:0.2
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg = [] ; <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">cfg.latency = [0 0.5];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">data_post = ft_selectdata(cfg,data) ;<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you in advance!</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards,</p>
<p class="MsoNormal">Chris</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">
Mail</a> for Windows 10</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>