Hello everyone,<div><br></div><div>I'm trying to use the crossf function to get values for the coherence across channels at different frequencies. I'm having trouble with the documentation of the function -- when I type help crossf into the matlab command line, it says that the output is as follows:</div>
<div><br></div><div><div>Outputs: </div><div> coh = Matrix (nfreqs,timesout) of coherence magnitudes </div><div> mcoh = Vector of mean baseline coherence at each frequency</div><div> timesout = Vector of output latencies (window centers) (ms).</div>
<div> freqsout = Vector of frequency bin centers (Hz).</div><div> cohboot = Matrix (nfreqs,2) of [lower;upper] coher signif. limits</div><div> if 'boottype' is 'trials', (nfreqs,timesout, 2)</div>
<div> cohangle = (nfreqs,timesout) matrix of coherence angles (in radians)</div><div> cohangles = (nfreqs,timesout,trials) matrix of single-trial coherence </div><div> angles (in radians), saved and output only if 'savecoher',1</div>
</div><div><br></div><div>What I am trying to do is average some evoked potential data, and then compare pair-wise, a series of the electrodes to determine their coherence, which I will eventually write to a file. I am new to this, so am having trouble understanding how to interpret the output of the crossf function, which I assume will give me what I am looking for. </div>
<div><br></div><div>So my questions is: the first output matrix that I get produces a 1.0 for every cell in the matrix for the electrodes I've tried -- is it likely that they are that in sync? That should be giving me the matrix of coherence magnitudes, correct? How is the coherence calculated? I also print out the mean baseline coherence, which also gives a matrix of 1s.</div>
<div><br></div><div>Here is a sample of the code I am trying to use (I am aware that the loops will only be executed once, this is for debugging purposes):</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="s1"><b>for </b></span><b>i=9:9,</b></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p2"><b> EEG = eeg_checkset( EEG );</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> disp(i);</b></p>
</div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> disp(channels{i});</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p2"><b> erp = pop_erpimage(EEG,1, [i],[],wcst_rare,0,1,{},[],<span class="s2">''</span> , <span class="s2">'yerplabel'</span>, <span class="s2">'\muV'</span>, <span class="s2">'erp'</span>, <span class="s2">'on'</span>, <span class="s2">'limits'</span>,[NaN NaN -25 25 NaN NaN NaN NaN] , <span class="s2">'cbar'</span>, <span class="s2">'on'</span>, <span class="s2">'vert'</span>,[170 300] );</b></p>
</div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> erp_avg = mean(erp,2);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p1"><b> </b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> <span class="s1">for</span> j=14:14,</b></p>
</div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> erp2 = pop_erpimage(EEG,1, [j],[],wcst_rare,0,1,{},[],<span class="s2">''</span> , <span class="s2">'yerplabel'</span>, <span class="s2">'\muV'</span>, <span class="s2">'erp'</span>, <span class="s2">'on'</span>, <span class="s2">'limits'</span>,[NaN NaN -25 25 NaN NaN NaN NaN] , <span class="s2">'cbar'</span>, <span class="s2">'on'</span>, <span class="s2">'vert'</span>,[170 300] );</b></p>
</div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> erp_avg2 = mean(erp2,2);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p2"><b> [R, mbase, times, freqs]= crossf(erp_avg,erp_avg2,1150,[-150 999],1000,0,<span class="s2">'type'</span>,<span class="s2">'coher'</span>);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p3"><span class="s3"><b> disp(</b></span></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>'Displaying coherence values'<span class="s3">);</span></b></div>
</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> disp(R);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p3"><span class="s3"><b> disp(</b></span></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>'Displaying mean baseline coherence values'<span class="s3">);</span></b></div>
</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> disp(mbase);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p3"><span class="s3"><b> disp(</b></span></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>'Displaying times'<span class="s3">);</span></b></div>
</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> disp(times);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p3"><span class="s3"><b> disp(</b></span></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>'Displaying freqs'<span class="s3">);</span></b></div>
</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> disp(freqs);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p2"><b> disp(<span class="s2">'Size of times'</span>);</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2">
<b> disp(size(times));</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p3"><span class="s3"><b> disp(</b></span></p>
</div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>'Size of freqs'<span class="s3">);</span></b></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><p class="p2"><b> disp(size(freqs));</b></p></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p2"><b> <span class="s1">end</span></b></p>
</div></blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p class="p1"><b>end</b></p></div></blockquote>